Merge pull request #182 from ClusterCockpit/179_fix_frontend_apiusers

Fix frontend render for users with api role
This commit is contained in:
Jan Eitzinger 2023-07-20 07:42:15 +02:00 committed by GitHub
commit c0ab5de2f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,10 +163,10 @@ func GetValidRoles(user *User) ([]string, error) {
return vals, fmt.Errorf("%s: only admins are allowed to fetch a list of roles", user.Username)
}
// Called by routerConfig web.page setup in backend: Only requires known user and/or not API user
// Called by routerConfig web.page setup in backend: Only requires known user
func GetValidRolesMap(user *User) (map[string]Role, error) {
named := make(map[string]Role)
if user.HasNotRoles([]Role{RoleApi, RoleAnonymous}) {
if user.HasNotRoles([]Role{RoleAnonymous}) {
for i := RoleApi; i < RoleError; i++ {
named[GetRoleString(i)] = i
}