From a3e6388c7c9791c54dd5625b68abddce0748be43 Mon Sep 17 00:00:00 2001 From: Rajshekar Chavakula Date: Fri, 15 Mar 2024 11:39:04 +0530 Subject: [PATCH] review comment addressal related to url fragment check Signed-off-by: Rajshekar Chavakula --- backend/apid/middlewares/authorization_attributes.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/apid/middlewares/authorization_attributes.go b/backend/apid/middlewares/authorization_attributes.go index c55350d53..ca748cd31 100644 --- a/backend/apid/middlewares/authorization_attributes.go +++ b/backend/apid/middlewares/authorization_attributes.go @@ -93,13 +93,8 @@ func (a AuthorizationAttributes) Then(next http.Handler) http.Handler { attrs.Resource = types.LocalSelfUserResource } - // check if request comes from webui - if strings.Contains(r.URL.Path, "/change_password") { - attrs.Resource = types.LocalSelfUserResource - } - switch vars["subresource"] { - case "password": + case "password", "change_password": attrs.Resource = types.LocalSelfUserResource } }