mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-10-31 07:55:06 +01:00 
			
		
		
		
	Merge pull request #182 from ClusterCockpit/179_fix_frontend_apiusers
Fix frontend render for users with api role
This commit is contained in:
		| @@ -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 | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user