mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: show organization name for groups on user profile (#14448)
This commit is contained in:
@@ -1503,7 +1503,7 @@ func (q *querier) GetGroupMembersCountByGroupID(ctx context.Context, groupID uui
|
||||
return memberCount, nil
|
||||
}
|
||||
|
||||
func (q *querier) GetGroups(ctx context.Context, arg database.GetGroupsParams) ([]database.Group, error) {
|
||||
func (q *querier) GetGroups(ctx context.Context, arg database.GetGroupsParams) ([]database.GetGroupsRow, error) {
|
||||
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceSystem); err == nil {
|
||||
// Optimize this query for system users as it is used in telemetry.
|
||||
// Calling authz on all groups in a deployment for telemetry jobs is
|
||||
|
||||
@@ -607,7 +607,10 @@ func (s *MethodTestSuite) TestOrganization() {
|
||||
check.Args(database.GetGroupsParams{
|
||||
OrganizationID: o.ID,
|
||||
}).Asserts(rbac.ResourceSystem, policy.ActionRead, a, policy.ActionRead, b, policy.ActionRead).
|
||||
Returns([]database.Group{a, b}).
|
||||
Returns([]database.GetGroupsRow{
|
||||
{Group: a, OrganizationName: o.Name, OrganizationDisplayName: o.DisplayName},
|
||||
{Group: b, OrganizationName: o.Name, OrganizationDisplayName: o.DisplayName},
|
||||
}).
|
||||
// Fail the system check shortcut
|
||||
FailSystemObjectChecks()
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user