mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
27 lines
442 B
Go
27 lines
442 B
Go
package auth
|
|
|
|
type Config struct {
|
|
RolePermissionMappings []RoleMapping
|
|
}
|
|
|
|
type RoleMapping struct {
|
|
Role string
|
|
Permissions []string
|
|
}
|
|
|
|
type MethodMapping map[string]Option
|
|
|
|
type Option struct {
|
|
Permission string
|
|
CheckParam string
|
|
}
|
|
|
|
func (a *Config) getPermissionsFromRole(role string) []string {
|
|
for _, roleMap := range a.RolePermissionMappings {
|
|
if roleMap.Role == role {
|
|
return roleMap.Permissions
|
|
}
|
|
}
|
|
return nil
|
|
}
|