Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dce10b5

Browse files
committed
where my members at yo
1 parent 91910af commit dce10b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/members.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ func (api *API) putMemberRoles(rw http.ResponseWriter, r *http.Request) {
5555

5656
// Assigning a role requires the create permission.
5757
if len(added) > 0 && !api.Authorize(r, rbac.ActionCreate, rbac.ResourceOrgRoleAssignment.InOrg(organization.ID)) {
58-
httpapi.Forbidden(rw)
58+
httpapi.ResourceNotFound(rw)
5959
return
6060
}
6161

6262
// Removing a role requires the delete permission.
6363
if len(removed) > 0 && !api.Authorize(r, rbac.ActionDelete, rbac.ResourceOrgRoleAssignment.InOrg(organization.ID)) {
64-
httpapi.Forbidden(rw)
64+
httpapi.ResourceNotFound(rw)
6565
return
6666
}
6767

6868
// Just treat adding & removing as "assigning" for now.
6969
for _, roleName := range append(added, removed...) {
7070
if !rbac.CanAssignRole(actorRoles.Actor.Roles, roleName) {
71-
httpapi.Forbidden(rw)
71+
httpapi.ResourceNotFound(rw)
7272
return
7373
}
7474
}

0 commit comments

Comments
 (0)