fix missing gin context (fixes #1)

This commit is contained in:
Adrian Zürcher
2025-10-26 21:05:55 +01:00
parent 8d8a1e3c33
commit 4670c93eff
6 changed files with 368 additions and 357 deletions

View File

@@ -1,7 +1,6 @@
package handlers
import (
"fmt"
"log"
"net/http"
"strings"
@@ -141,8 +140,7 @@ func (aH *AccessHandler) AuthorizeRole(suffix string) gin.HandlerFunc {
// Validate that a role was found
if len(roles) == 0 {
log.Println("not logged in")
aH.logger.Error("AuthorizeRole", "no logged in")
aH.logger.Error("AuthorizeRole", "not logged in")
c.JSON(http.StatusUnauthorized, http.StatusUnauthorized)
return
} else if len(roles) > 1 {
@@ -153,7 +151,6 @@ func (aH *AccessHandler) AuthorizeRole(suffix string) gin.HandlerFunc {
// Check permissions
for _, permission := range roles[0].Permissions {
fmt.Println(100, permissionPath, permission.Name)
if permission.Name == permissionPath {
c.Next()
return