diff options
Diffstat (limited to '')
-rw-r--r-- | acl.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 } |