AccessControl: Modify provisioning to prevent built-in role assignment (#48031)

* Add basic and managed prefixes to avoid magic strings
For now let's stick with grafana_builtins
add function isBasic to RoleDTO
add function isBasic to Role

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Add team store to wire

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
This commit is contained in:
Gabriel MABILLE
2022-04-21 14:14:45 +02:00
committed by GitHub
co-authored by Jguer
parent b727c324b8
commit 9ed7e48454
3 changed files with 17 additions and 4 deletions
@@ -32,7 +32,7 @@ type flatResourcePermission struct {
}
func (p *flatResourcePermission) IsManaged() bool {
return strings.HasPrefix(p.RoleName, "managed:") && !p.IsInherited()
return strings.HasPrefix(p.RoleName, accesscontrol.ManagedRolePrefix) && !p.IsInherited()
}
func (p *flatResourcePermission) IsInherited() bool {