1
0
mirror of https://github.com/zitadel/zitadel.git synced 2024-12-27 18:17:49 +00:00

28 lines
484 B
Go
Raw Normal View History

package authz
2020-03-23 07:01:59 +01:00
type Config struct {
RolePermissionMappings []RoleMapping
}
type RoleMapping struct {
Role string
Permissions []string
}
type MethodMapping map[string]Option
type Option struct {
Permission string
CheckParam string
AllowSelf bool
2020-03-23 07:01:59 +01:00
}
func getPermissionsFromRole(rolePermissionMappings []RoleMapping, role string) []string {
for _, roleMap := range rolePermissionMappings {
2020-03-23 07:01:59 +01:00
if roleMap.Role == role {
return roleMap.Permissions
}
}
return nil
}