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

Skip to content

Commit 76a2e89

Browse files
committed
add more comments around OverrideSQLFilter
1 parent f025242 commit 76a2e89

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

coderd/coderdtest/authorize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ func (d *FakeAuthorizer) AlwaysReturn(err error) *FakeAuthorizer {
372372
return d
373373
}
374374

375-
// OverrideSQLFilter overrides the SQL filter for the FakeAuthorizer.
375+
// OverrideSQLFilter sets the SQL filter that will always be returned by CompileToSQL.
376376
func (d *FakeAuthorizer) OverrideSQLFilter(filter string) *FakeAuthorizer {
377377
d.sqlFilter = filter
378378
return d

coderd/database/dbauthz/setup_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ func (s *MethodTestSuite) NoActorErrorTest(callMethod func(ctx context.Context)
243243
func (s *MethodTestSuite) NotAuthorizedErrorTest(ctx context.Context, az *coderdtest.FakeAuthorizer, testCase expects, callMethod func(ctx context.Context) ([]reflect.Value, error)) {
244244
s.Run("NotAuthorized", func() {
245245
az.AlwaysReturn(rbac.ForbiddenWithInternal(xerrors.New("Always fail authz"), rbac.Subject{}, "", rbac.Object{}, nil))
246+
// Override the SQL filter to always fail.
246247
az.OverrideSQLFilter("FALSE")
247248

248249
// If we have assertions, that means the method should FAIL

0 commit comments

Comments
 (0)