Skip to content

Commit 5d32d9d

Browse files
committed
Fix using User over UserData
1 parent 186eb5f commit 5d32d9d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

coderd/rbac/object.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var (
6969
}
7070

7171
// ResourceOrganizationMember is a user's membership in an organization.
72-
// Has ONLY an organization owner.
72+
// Has ONLY an organization owner. The resource ID is the user's ID
7373
// create/delete = Create/delete member from org.
7474
// update = Update organization member
7575
// read = View member

coderd/users.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (api *api) userByName(rw http.ResponseWriter, r *http.Request) {
245245
func (api *api) putUserProfile(rw http.ResponseWriter, r *http.Request) {
246246
user := httpmw.UserParam(r)
247247

248-
if !api.Authorize(rw, r, rbac.ActionUpdate, rbac.ResourceUserData.WithOwner(user.ID.String())) {
248+
if !api.Authorize(rw, r, rbac.ActionUpdate, rbac.ResourceUser.WithOwner(user.ID.String())) {
249249
return
250250
}
251251

@@ -420,7 +420,7 @@ func (api *api) putUserRoles(rw http.ResponseWriter, r *http.Request) {
420420
user := httpmw.UserParam(r)
421421
roles := httpmw.UserRoles(r)
422422

423-
if !api.Authorize(rw, r, rbac.ActionUpdate, rbac.ResourceUserData.WithOwner(user.ID.String())) {
423+
if !api.Authorize(rw, r, rbac.ActionUpdate, rbac.ResourceUser.WithOwner(user.ID.String())) {
424424
return
425425
}
426426

0 commit comments

Comments
 (0)