Skip to content

Commit a9f0a38

Browse files
committed
fixup field name changes
1 parent a6996f6 commit a9f0a38

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,19 +620,19 @@ func (q *querier) canAssignRoles(ctx context.Context, orgID *uuid.UUID, added, r
620620
}
621621

622622
if len(customRoles) > 0 {
623-
customRoles, err := q.CustomRolesByName(ctx, customRoles)
623+
expandedCustomRoles, err := q.CustomRolesByName(ctx, customRoles)
624624
if err != nil {
625625
return xerrors.Errorf("fetching custom roles: %w", err)
626626
}
627627

628628
// If the lists are not identical, then have a problem, as some roles
629629
// provided do no exist.
630-
if len(customRoles) != len(customRoles) {
630+
if len(customRoles) != len(expandedCustomRoles) {
631631
for _, role := range customRoles {
632632
// Stop at the first one found. We could make a better error that
633633
// returns them all, but then someone could pass in a large list to make us do
634634
// a lot of loop iterations.
635-
if !slices.ContainsFunc(customRoles, func(customRole database.CustomRole) bool {
635+
if !slices.ContainsFunc(expandedCustomRoles, func(customRole database.CustomRole) bool {
636636
return strings.EqualFold(customRole.Name, role)
637637
}) {
638638
return xerrors.Errorf("%q is not a supported role", role)

coderd/database/dbmem/dbmem.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8291,7 +8291,7 @@ func (q *FakeQuerier) UpsertCustomRole(_ context.Context, arg database.UpsertCus
82918291
q.customRoles[i].SitePermissions = arg.SitePermissions
82928292
q.customRoles[i].OrgPermissions = arg.OrgPermissions
82938293
q.customRoles[i].UserPermissions = arg.UserPermissions
8294-
q.customRoles[i].LastUpdated = dbtime.Now()
8294+
q.customRoles[i].UpdatedAt = dbtime.Now()
82958295
return q.customRoles[i], nil
82968296
}
82978297
}
@@ -8303,7 +8303,7 @@ func (q *FakeQuerier) UpsertCustomRole(_ context.Context, arg database.UpsertCus
83038303
OrgPermissions: arg.OrgPermissions,
83048304
UserPermissions: arg.UserPermissions,
83058305
CreatedAt: dbtime.Now(),
8306-
LastUpdated: dbtime.Now(),
8306+
UpdatedAt: dbtime.Now(),
83078307
}
83088308
q.customRoles = append(q.customRoles, role)
83098309

0 commit comments

Comments
 (0)