Skip to content

Commit 5fcc218

Browse files
committed
rename UserWithGroupAndOrgID to GroupMemberRBACHelper
1 parent 5391c15 commit 5fcc218

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,17 +1401,17 @@ func (q *querier) GetGroupMembersByGroupID(ctx context.Context, id uuid.UUID) ([
14011401
if err != nil { // AuthZ check
14021402
return nil, err
14031403
}
1404-
// The UserWithGroupAndOrgID type is used to do the authz check. It ensures
1404+
// The GroupMemberRBACHelper type is used to do the authz check. It ensures
14051405
// that group members can see themselves. Unless they have Group read permissions,
14061406
// they cannot see other members.
1407-
fetch := func(ctx context.Context, _ any) ([]database.UserWithGroupAndOrgID, error) {
1407+
fetch := func(ctx context.Context, _ any) ([]database.GroupMemberRBACHelper, error) {
14081408
users, err := q.db.GetGroupMembersByGroupID(ctx, id)
14091409
if err != nil {
14101410
return nil, err
14111411
}
1412-
groupMembers := make([]database.UserWithGroupAndOrgID, len(users))
1412+
groupMembers := make([]database.GroupMemberRBACHelper, len(users))
14131413
for i, user := range users {
1414-
groupMembers[i] = database.UserWithGroupAndOrgID{
1414+
groupMembers[i] = database.GroupMemberRBACHelper{
14151415
User: user,
14161416
GroupID: group.ID,
14171417
OrganizationID: group.OrganizationID,

coderd/database/modelmethods.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ func (g Group) RBACObject() rbac.Object {
183183
})
184184
}
185185

186-
type UserWithGroupAndOrgID struct {
186+
type GroupMemberRBACHelper struct {
187187
User User
188188
GroupID uuid.UUID
189189
OrganizationID uuid.UUID
190190
}
191191

192-
func (gm UserWithGroupAndOrgID) RBACObject() rbac.Object {
192+
func (gm GroupMemberRBACHelper) RBACObject() rbac.Object {
193193
return rbac.ResourceGroup.WithID(gm.GroupID).InOrg(gm.OrganizationID).
194194
// Group member can see they are in the group.
195195
WithACLUserList(map[string][]policy.Action{

0 commit comments

Comments
 (0)