diff --git a/manager/middlewares/rbac.go b/manager/middlewares/rbac.go index a7bde75aa..31f8105b6 100644 --- a/manager/middlewares/rbac.go +++ b/manager/middlewares/rbac.go @@ -104,6 +104,12 @@ func isAccessGranted(c *gin.Context) bool { client := makeClient(c.GetHeader("x-rh-identity")) access := rbac.AccessPagination{} res, err := client.Request(&base.Context, http.MethodGet, rbacURL, nil, &access) + if res != nil { + utils.LogDebug("response_headers", res.Header, "request_headers", res.Request.Header, "isAccessGranted rbac") + } + if c.Request != nil { + utils.LogDebug("gin_context_req", *c.Request, "isAccessGranted rbac") + } if res != nil && res.Body != nil { defer res.Body.Close() } @@ -195,6 +201,9 @@ func RBAC() gin.HandlerFunc { if isAccessGranted(c) { return } + if c.Request != nil { + utils.LogDebug("context_req", c.Request, "RBAC") + } c.AbortWithStatusJSON(http.StatusUnauthorized, utils.ErrorResponse{Error: "You don't have access to this application"}) }