* RBAC: Add IsInherited property
* PermissionList: Display inherited indicator
(cherry picked from commit cc78486535)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
co-authored by
Karl Persson
parent
c8a313c289
commit
493c7866a2
@@ -34,7 +34,7 @@ func (p *flatResourcePermission) IsManaged(scope string) bool {
|
||||
}
|
||||
|
||||
func (p *flatResourcePermission) IsInherited(scope string) bool {
|
||||
return p.Scope != scope
|
||||
return !strings.HasPrefix(p.Scope, strings.Split(strings.ReplaceAll(scope, "*", ""), ":")[0])
|
||||
}
|
||||
|
||||
func (s *AccessControlStore) SetUserResourcePermission(
|
||||
@@ -472,6 +472,7 @@ func flatPermissionsToResourcePermission(scope string, permissions []flatResourc
|
||||
Created: first.Created,
|
||||
Updated: first.Updated,
|
||||
IsManaged: first.IsManaged(scope),
|
||||
IsInherited: first.IsInherited(scope),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user