aboutsummaryrefslogtreecommitdiff
path: root/acl.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
}