diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-19 20:14:20 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-19 20:14:20 +0800 |
commit | de1b961fbf54601f25c54c1618f11978f6618858 (patch) | |
tree | c79cbc96edf80075d57591a409b27ee29c60d7a5 /acl.go | |
parent | css: .commit-id { work-break: break-word; } (diff) | |
download | forge-de1b961fbf54601f25c54c1618f11978f6618858.tar.gz forge-de1b961fbf54601f25c54c1618f11978f6618858.tar.zst forge-de1b961fbf54601f25c54c1618f11978f6618858.zip |
ssh/recv, schema: Add repos.contrib_requirements
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 } |