mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: create type for unique role names (#13506)
* chore: create type for unique role names Using `string` was confusing when something should be combined with org context, and when not to. Naming this new name, "RoleIdentifier"
This commit is contained in:
@ -199,7 +199,8 @@ func (api *API) convertAuditLog(ctx context.Context, dblog database.GetAuditLogs
|
||||
Roles: []codersdk.SlimRole{},
|
||||
}
|
||||
|
||||
for _, roleName := range dblog.UserRoles {
|
||||
for _, input := range dblog.UserRoles {
|
||||
roleName, _ := rbac.RoleNameFromString(input)
|
||||
rbacRole, _ := rbac.RoleByName(roleName)
|
||||
user.Roles = append(user.Roles, db2sdk.SlimRole(rbacRole))
|
||||
}
|
||||
|
Reference in New Issue
Block a user