ACL: Add RoleStrings type to specify role names

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2023-01-30 16:15:01 +01:00
parent 1dee168e52
commit 8593da5b78

View file

@ -8,8 +8,11 @@ const (
RoleUnknown Role = ""
)
// RoleStrings represents user role names mapped to roles.
type RoleStrings = map[string]Role
// ValidRoles specifies the valid user roles.
var ValidRoles = map[string]Role{
var ValidRoles = RoleStrings{
string(RoleAdmin): RoleAdmin,
string(RoleVisitor): RoleVisitor,
string(RoleUnknown): RoleUnknown,