photoprism/internal/acl/grants.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

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
}