aboutsummaryrefslogtreecommitdiff
path: root/acl.go
diff options
context:
space:
mode:
Diffstat (limited to 'acl.go')
-rw-r--r--acl.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/acl.go b/acl.go
index d2e8190..8d23dc3 100644
--- a/acl.go
+++ b/acl.go
@@ -9,9 +9,9 @@ import (
"github.com/jackc/pgx/v5/pgtype"
)
-// get_path_perm_by_group_repo_key returns the filesystem path and direct
+// getRepoInfo 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_path []string, repo_name, ssh_pubkey string) (repo_id int, filesystem_path string, access bool, contrib_requirements, user_type string, user_id int, err error) {
+func getRepoInfo(ctx context.Context, group_path []string, repoName, sshPubkey string) (repoID int, fsPath string, access bool, contribReq, userType string, userID int, err error) {
err = database.QueryRow(ctx, `
WITH RECURSIVE group_path_cte AS (
-- Start: match the first name in the path where parent_group IS NULL
@@ -51,7 +51,7 @@ LEFT JOIN users u ON u.id = s.user_id
LEFT JOIN user_group_roles ugr ON ugr.group_id = g.id AND ugr.user_id = u.id
WHERE g.depth = cardinality($1::text[])
AND r.name = $2
-`, pgtype.FlatArray[string](group_path), repo_name, ssh_pubkey,
- ).Scan(&repo_id, &filesystem_path, &access, &contrib_requirements, &user_type, &user_id)
+`, pgtype.FlatArray[string](group_path), repoName, sshPubkey,
+ ).Scan(&repoID, &fsPath, &access, &contribReq, &userType, &userID)
return
}