Skip to content

Commit b4a5cfb

Browse files
hugoShakakopiczko
andauthored
Apply suggestions from code review
Co-authored-by: Pawel Kopiczko <[email protected]>
1 parent 2916d1e commit b4a5cfb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/accesslists/hierarchy.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func IsUserLocked(err error) bool {
264264

265265
// IsAccessListOwner checks if the given user is the Access List owner.
266266
// It returns an error matched by [IsUserLocked] if the user is locked.
267-
// If the user is not am owner, it returns a trace.AccessDenied error.
267+
// If the user is not an owner, it returns a trace.AccessDenied error.
268268
func IsAccessListOwner(
269269
ctx context.Context,
270270
user types.User,
@@ -305,8 +305,7 @@ func IsAccessListOwner(
305305
return accesslistv1.AccessListUserAssignmentType_ACCESS_LIST_USER_ASSIGNMENT_TYPE_UNSPECIFIED, trace.Wrap(err)
306306
}
307307
// Since we already verified that the user is not locked, don't provide lockGetter here
308-
_, err = IsAccessListMember(ctx, user, ownerAccessList, g, nil, clock)
309-
if err != nil {
308+
if _, err := IsAccessListMember(ctx, user, ownerAccessList, g, nil, clock); err != nil {
310309
if trace.IsAccessDenied(err) {
311310
ownershipErr = trace.Wrap(err)
312311
continue

lib/accesslists/hierarchy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func TestAccessListIsMember_RequirementsAndExpiry(t *testing.T) {
275275

276276
func TestAccessListIsMember_NestedRequirements(t *testing.T) {
277277
clock := clockwork.NewFakeClock()
278-
ctx := context.Background()
278+
ctx := t.Context()
279279
locks := &mockLocksGetter{}
280280

281281
t.Run("nested lists with requirements at multiple levels", func(t *testing.T) {

0 commit comments

Comments
 (0)