setting of context roleid from claims
This commit is contained in:
@@ -69,6 +69,9 @@ func AuthorizeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
ctx.Environment = make(map[string]string)
|
||||
}
|
||||
|
||||
// Set RoleID from claims
|
||||
ctx.RoleID = claims.RoleID
|
||||
log.Print("Set context RoleID to ", ctx.RoleID)
|
||||
// Perform authorization
|
||||
log.Printf("[Handler] Performing authorization check for user=%s, resource=%s, action=%s", ctx.UserID, ctx.Resource, ctx.Action)
|
||||
result, err := services.AuthorizeWithCache(authService, &ctx)
|
||||
|
||||
Reference in New Issue
Block a user