mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
RBAC: Allow omitting default permissions when a new resource is created (#90720)
* Cfg: Move rbac settings to own struct * Cfg: Add setting to control if resource should generate managed permissions when created * Dashboards: Check if we should generate default permissions when dashboard is created * Folders: Check if we should generate default permissions when folder is created * Datasource: Check if we should generate default permissions when datasource is created * ServiceAccount: Check if we should generate default permissions when service account is created * Cfg: Add option to specify resources for wich we should default seed * ManagedPermissions: Move providers to their own files * Dashboards: Default seed all possible managed permissions if configured * Folders: Default seed all possible managed permissions if configured * Cfg: Remove service account from list * RBAC: Move utility function * remove managed permission settings from the config file examples, change the setting names * remove ini file changes from the PR * fix setting reading * fix linting errors * fix tests * fix wildcard role seeding --------- Co-authored-by: Karl Persson <kalle.persson@grafana.com> Co-authored-by: jguer <me@jguer.space>
This commit is contained in:
co-authored by
Karl Persson
jguer
parent
82236976ae
commit
9bb2cf4968
@@ -119,7 +119,7 @@ func (s *Service) GetUserPermissions(ctx context.Context, user identity.Requeste
|
||||
timer := prometheus.NewTimer(metrics.MAccessPermissionsSummary)
|
||||
defer timer.ObserveDuration()
|
||||
|
||||
if !s.cfg.RBACPermissionCache || !user.HasUniqueId() {
|
||||
if !s.cfg.RBAC.PermissionCache || !user.HasUniqueId() {
|
||||
return s.getUserPermissions(ctx, user, options)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user