Skip to content

chore: add display name to member role #10239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Do not let member role be assignable
  • Loading branch information
Emyrk committed Oct 12, 2023
commit bd5373409fde4ff7a97f8403ac93a88b7565a033
3 changes: 2 additions & 1 deletion coderd/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func (api *API) assignableOrgRoles(rw http.ResponseWriter, r *http.Request) {
func assignableRoles(actorRoles rbac.ExpandableRoles, roles []rbac.Role) []codersdk.AssignableRoles {
assignable := make([]codersdk.AssignableRoles, 0)
for _, role := range roles {
if role.DisplayName == "" {
// The member role is implied, and not assignable.
if role.Name == rbac.RoleMember() {
continue
}
assignable = append(assignable, codersdk.AssignableRoles{
Expand Down