aboutsummaryrefslogtreecommitdiff
path: root/acl.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-19 20:14:20 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-19 20:14:20 +0800
commitde1b961fbf54601f25c54c1618f11978f6618858 (patch)
treec79cbc96edf80075d57591a409b27ee29c60d7a5 /acl.go
parentcss: .commit-id { work-break: break-word; } (diff)
downloadforge-de1b961fbf54601f25c54c1618f11978f6618858.tar.gz
forge-de1b961fbf54601f25c54c1618f11978f6618858.tar.zst
forge-de1b961fbf54601f25c54c1618f11978f6618858.zip
ssh/recv, schema: Add repos.contrib_requirements
Diffstat (limited to 'acl.go')
-rw-r--r--acl.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/acl.go b/acl.go
index 22c8a4c..095c1f1 100644
--- a/acl.go
+++ b/acl.go
@@ -6,14 +6,19 @@ import (
// get_path_perm_by_group_repo_key returns the filesystem path and direct
// access permission for a given repo and a provided ssh public key.
-func get_path_perm_by_group_repo_key(ctx context.Context, group_name, repo_name, ssh_pubkey string) (filesystem_path string, access bool, err error) {
+func get_path_perm_by_group_repo_key(ctx context.Context, group_name, repo_name, ssh_pubkey string) (filesystem_path string, access bool, contrib_requirements string, is_registered_user bool, err error) {
err = database.QueryRow(ctx,
`SELECT
r.filesystem_path,
CASE
WHEN ugr.user_id IS NOT NULL THEN TRUE
ELSE FALSE
- END AS has_role_in_group
+ END AS has_role_in_group,
+ r.contrib_requirements,
+ CASE
+ WHEN u.id IS NOT NULL THEN TRUE
+ ELSE FALSE
+ END
FROM
groups g
JOIN
@@ -28,6 +33,6 @@ func get_path_perm_by_group_repo_key(ctx context.Context, group_name, repo_name,
g.name = $1
AND r.name = $2;`,
group_name, repo_name, ssh_pubkey,
- ).Scan(&filesystem_path, &access)
+ ).Scan(&filesystem_path, &access, &contrib_requirements, &is_registered_user)
return
}