Access control: Display inherited folder permissions in dashboards (#46421)

This commit is contained in:
Karl Persson
2022-03-17 17:08:51 +01:00
committed by GitHub
parent fb17b9f545
commit 4df7bf5ab2
13 changed files with 142 additions and 129 deletions
+1 -5
View File
@@ -195,7 +195,6 @@ type ScopeParams struct {
// can perform against specific resource.
type ResourcePermission struct {
ID int64
ResourceID string
RoleName string
Actions []string
Scope string
@@ -206,14 +205,11 @@ type ResourcePermission struct {
TeamEmail string
Team string
BuiltInRole string
IsManaged bool
Created time.Time
Updated time.Time
}
func (p *ResourcePermission) IsManaged() bool {
return strings.HasPrefix(p.RoleName, "managed:")
}
func (p *ResourcePermission) Contains(targetActions []string) bool {
if len(p.Actions) < len(targetActions) {
return false