mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 14:52:16 +08:00
AccessControl: Replace IsEnterprise checks with license checks (#49572)
This commit is contained in:
@ -250,15 +250,15 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
// current org without requirement of user to be org admin
|
||||
apiRoute.Group("/org", func(orgRoute routing.RouteRegister) {
|
||||
lookupEvaluator := func() ac.Evaluator {
|
||||
if hs.Cfg.IsEnterprise {
|
||||
if hs.License.FeatureEnabled("accesscontrol.enforcement") {
|
||||
return ac.EvalPermission(ac.ActionOrgUsersRead)
|
||||
}
|
||||
// For oss we allow users with access to update permissions on either folders, teams or dashboards to perform the lookup
|
||||
return ac.EvalAny(
|
||||
ac.EvalPermission(ac.ActionOrgUsersRead),
|
||||
ac.EvalPermission(ac.ActionTeamsPermissionsWrite),
|
||||
ac.EvalPermission(dashboards.ActionDashboardsPermissionsWrite),
|
||||
ac.EvalPermission(dashboards.ActionFoldersPermissionsWrite),
|
||||
ac.EvalPermission(dashboards.ActionDashboardsPermissionsWrite),
|
||||
)
|
||||
}
|
||||
orgRoute.Get("/users/lookup", authorize(reqOrgAdminFolderAdminOrTeamAdmin, lookupEvaluator()), routing.Wrap(hs.GetOrgUsersForCurrentOrgLookup))
|
||||
|
Reference in New Issue
Block a user