mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
a4763b1e4c
* features * features * features * fix json tags * add features handler to auth * mocks for tests * add setup step * fixes * add featurelist to auth api * grandfather state and typos * typo * merge new-eventstore * fix login policy tests * label policy in features * audit log retention
28 lines
462 B
Go
28 lines
462 B
Go
package authz
|
|
|
|
type Config struct {
|
|
RolePermissionMappings []RoleMapping
|
|
}
|
|
|
|
type RoleMapping struct {
|
|
Role string
|
|
Permissions []string
|
|
}
|
|
|
|
type MethodMapping map[string]Option
|
|
|
|
type Option struct {
|
|
Permission string
|
|
CheckParam string
|
|
Feature string
|
|
}
|
|
|
|
func (a *Config) getPermissionsFromRole(role string) []string {
|
|
for _, roleMap := range a.RolePermissionMappings {
|
|
if roleMap.Role == role {
|
|
return roleMap.Permissions
|
|
}
|
|
}
|
|
return nil
|
|
}
|