Skip to content

Commit f9b0d9a

Browse files
committed
fix: rbac fix for global variable list api
1 parent 4321dab commit f9b0d9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/restHandler/GlobalPluginRestHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ func (handler *GlobalPluginRestHandlerImpl) GetAllGlobalVariables(w http.Respons
184184
object := handler.enforcerUtil.GetAppRBACNameByAppId(appId)
185185
authorised := false
186186
if app.AppType == helper.Job {
187-
authorised = handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, object)
188-
} else if app.AppType == helper.CustomApp {
189187
authorised = handler.enforcer.Enforce(token, casbin.ResourceJobs, casbin.ActionGet, object)
188+
} else if app.AppType == helper.CustomApp {
189+
authorised = handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, object)
190190
}
191191
if !authorised {
192192
common.WriteJsonResp(w, common.ErrUnAuthorized, nil, http.StatusForbidden)

0 commit comments

Comments
 (0)