mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 16:52:36 +08:00
Access Control: Rename global users scope (#46794)
* Rename scope from global:users to global.users to match scope convention
This commit is contained in:
@ -174,7 +174,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
}, reqSignedInNoAnonymous)
|
||||
|
||||
apiRoute.Group("/users", func(usersRoute routing.RouteRegister) {
|
||||
userIDScope := ac.Scope("global", "users", "id", ac.Parameter(":id"))
|
||||
userIDScope := ac.Scope("global.users", "id", ac.Parameter(":id"))
|
||||
usersRoute.Get("/", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionUsersRead, ac.ScopeGlobalUsersAll)), routing.Wrap(hs.searchUsersService.SearchUsers))
|
||||
usersRoute.Get("/search", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionUsersRead, ac.ScopeGlobalUsersAll)), routing.Wrap(hs.searchUsersService.SearchUsersWithPaging))
|
||||
usersRoute.Get("/:id", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionUsersRead, userIDScope)), routing.Wrap(hs.GetUserByID))
|
||||
@ -516,7 +516,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
|
||||
// Administering users
|
||||
r.Group("/api/admin/users", func(adminUserRoute routing.RouteRegister) {
|
||||
userIDScope := ac.Scope("global", "users", "id", ac.Parameter(":id"))
|
||||
userIDScope := ac.Scope("global.users", "id", ac.Parameter(":id"))
|
||||
|
||||
adminUserRoute.Post("/", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionUsersCreate)), routing.Wrap(hs.AdminCreateUser))
|
||||
adminUserRoute.Put("/:id/password", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionUsersPasswordUpdate, userIDScope)), routing.Wrap(hs.AdminUpdateUserPassword))
|
||||
|
Reference in New Issue
Block a user