Skip to content

Commit b89b430

Browse files
committed
doc.go
1 parent 7a14b64 commit b89b430

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

coderd/database/dbauthz/doc.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Package dbauthz provides an authorization layer on top of the database. This
2+
// package exposes an interface that is currently a 1:1 mapping with
3+
// database.Store.
4+
//
5+
// The same cultural rules apply to this package as they do to database.Store.
6+
// Meaning that each method implemented should keep the number of database
7+
// queries as close to 1 as possible. Each method should do 1 thing, with no
8+
// unexpected side effects (eg: updating multiple tables in a single method).
9+
//
10+
// Avoid implementing business logic in this package. Only authorization related
11+
// logic should be implemented here. In most cases, this should only be a call to
12+
// the rbac authorizer.
13+
//
14+
// When a new database method is added to database.Store, it should be added to
15+
// this package as well. The unit test "Accounting" will ensure all methods are
16+
// tested. See other unit tests for examples on how to write these.
17+
package dbauthz

0 commit comments

Comments
 (0)