Skip to content

Commit 4ef3b4e

Browse files
committed
fixup! chore: add linter to detect potential spurious usage of owner user in tests
1 parent 23a2658 commit 4ef3b4e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

scripts/rules.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,9 @@ func dbauthzAuthorizationContext(m dsl.Matcher) {
4444
}
4545

4646
// testingWithOwnerUser is a lint rule that detects potential permission bugs.
47-
// Calling CreateFirstUser in a test is fine, but we should avoid
48-
// using the the methods of the client passed to it.
49-
// However, using it in coderdtest.* methods is generally OK since
50-
// these are used to setup the test environment.
51-
//
52-
// Similarly, calling clitest.SetupConfig with a client authenticated
53-
// as the Owner user can be a problem, since the CLI will be operating
54-
// as the owner user and we may miss permission bugs.
47+
// Calling clitest.SetupConfig with a client authenticated as the Owner user
48+
// can be a problem, since the CLI will be operating as that user and we may
49+
// miss permission bugs.
5550
//
5651
//nolint:unused,deadcode,varnamelen
5752
func testingWithOwnerUser(m dsl.Matcher) {

0 commit comments

Comments
 (0)