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

Skip to content

Commit d3affdc

Browse files
committed
Fix merge compile issues
1 parent a32b4f3 commit d3affdc

File tree

4 files changed

+9
-40
lines changed

4 files changed

+9
-40
lines changed

coderd/authzquery/group.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ func (q *AuthzQuerier) DeleteGroupMemberFromGroup(ctx context.Context, arg datab
2222
return authorizedUpdate(q.logger, q.authorizer, fetch, q.database.DeleteGroupMemberFromGroup)(ctx, arg)
2323
}
2424

25+
func (q *AuthzQuerier) InsertUserGroupsByName(ctx context.Context, arg database.InsertUserGroupsByNameParams) error {
26+
panic("not implemented")
27+
}
28+
29+
func (q *AuthzQuerier) DeleteGroupMembersByOrgAndUser(ctx context.Context, arg database.DeleteGroupMembersByOrgAndUserParams) error {
30+
panic("not implemented")
31+
}
32+
2533
func (q *AuthzQuerier) GetGroupByID(ctx context.Context, id uuid.UUID) (database.Group, error) {
2634
return authorizedFetch(q.logger, q.authorizer, q.database.GetGroupByID)(ctx, id)
2735
}

coderd/authzquery/template.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,6 @@ func (q *AuthzQuerier) GetTemplateVersionByJobID(ctx context.Context, jobID uuid
9494
)(ctx, jobID)
9595
}
9696

97-
func (q *AuthzQuerier) GetTemplateVersionByOrganizationAndName(ctx context.Context, arg database.GetTemplateVersionByOrganizationAndNameParams) (database.TemplateVersion, error) {
98-
// An actor can read the template version if they can read the related template in the organization.
99-
fetchRelated := func(tv database.TemplateVersion, p database.GetTemplateVersionByOrganizationAndNameParams) (rbac.Objecter, error) {
100-
if !tv.TemplateID.Valid {
101-
// If no linked template exists, check if the actor can read
102-
// any template in the organization.
103-
return rbac.ResourceTemplate.InOrg(p.OrganizationID), nil
104-
}
105-
return q.database.GetTemplateByID(ctx, tv.TemplateID.UUID)
106-
}
107-
108-
return authorizedQueryWithRelated(
109-
q.logger,
110-
q.authorizer,
111-
rbac.ActionRead,
112-
fetchRelated,
113-
q.database.GetTemplateVersionByOrganizationAndName,
114-
)(ctx, arg)
115-
}
116-
11797
func (q *AuthzQuerier) GetTemplateVersionByTemplateIDAndName(ctx context.Context, arg database.GetTemplateVersionByTemplateIDAndNameParams) (database.TemplateVersion, error) {
11898
// An actor can read the template version if they can read the related template.
11999
fetchRelated := func(tv database.TemplateVersion, p database.GetTemplateVersionByTemplateIDAndNameParams) (rbac.Objecter, error) {

coderd/authzquery/workspace.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -212,26 +212,6 @@ func (q *AuthzQuerier) GetWorkspaceByOwnerIDAndName(ctx context.Context, arg dat
212212
return authorizedFetch(q.logger, q.authorizer, q.database.GetWorkspaceByOwnerIDAndName)(ctx, arg)
213213
}
214214

215-
func (q *AuthzQuerier) GetWorkspaceOwnerCountsByTemplateIDs(ctx context.Context, ids []uuid.UUID) ([]database.GetWorkspaceOwnerCountsByTemplateIDsRow, error) {
216-
// Would be nice if this was just returned in the GetTemplates() call.
217-
// This is not very efficient, but it is the way to ensure read access to the templates
218-
// being queried. Most of the time, the templates are already fetched and authorized.
219-
// TODO: Optimize this
220-
tpls, err := q.GetTemplatesWithFilter(ctx, database.GetTemplatesWithFilterParams{
221-
IDs: ids,
222-
})
223-
if err != nil {
224-
return nil, err
225-
}
226-
227-
allowed := make([]uuid.UUID, 0, len(tpls))
228-
for _, tpl := range tpls {
229-
allowed = append(allowed, tpl.ID)
230-
}
231-
232-
return q.database.GetWorkspaceOwnerCountsByTemplateIDs(ctx, allowed)
233-
}
234-
235215
func (q *AuthzQuerier) GetWorkspaceResourceByID(ctx context.Context, id uuid.UUID) (database.WorkspaceResource, error) {
236216
// TODO: Optimize this
237217
resource, err := q.database.GetWorkspaceResourceByID(ctx, id)

coderd/userauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ type oauthLoginParams struct {
453453
Email string
454454
Username string
455455
AvatarURL string
456+
Groups []string
456457
}
457458

458459
type httpError struct {

0 commit comments

Comments
 (0)