f5a8c5a45d
Signed-off-by: Michael Mayer <michael@photoprism.app>
15 lines
353 B
Go
15 lines
353 B
Go
package acl
|
|
|
|
// Grants represents Permission Grant by Resource.
|
|
type Grants map[Resource]Grant
|
|
|
|
// Grants returns the permissions granted to the specified Role by Resource.
|
|
func (acl ACL) Grants(role Role) Grants {
|
|
result := make(map[Resource]Grant, len(acl))
|
|
|
|
for resource := range acl {
|
|
result[resource] = acl[resource][role]
|
|
}
|
|
|
|
return result
|
|
}
|