aboutsummaryrefslogtreecommitdiff
path: root/internal/db/perms.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2023-02-05 16:28:47 +0800
committerGitHub <noreply@github.com>2023-02-05 16:28:47 +0800
commit7ff09cf35916cad50495c26a47f4c0d05487e24e (patch)
treedc4516234c3a8e72051e2ab1674adb7e7c32c3cc /internal/db/perms.go
parent3c43b9b21c74faf60d62b2cbf2ee89e9ada37f0c (diff)
refactor(db): migrate methods off `user.go` (#7336)
Diffstat (limited to 'internal/db/perms.go')
-rw-r--r--internal/db/perms.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/db/perms.go b/internal/db/perms.go
index a72a013a..b0a1a85a 100644
--- a/internal/db/perms.go
+++ b/internal/db/perms.go
@@ -82,6 +82,12 @@ type perms struct {
*gorm.DB
}
+// NewPermsStore returns a persistent interface for permissions with given
+// database connection.
+func NewPermsStore(db *gorm.DB) PermsStore {
+ return &perms{DB: db}
+}
+
type AccessModeOptions struct {
OwnerID int64 // The ID of the repository owner.
Private bool // Whether the repository is private.