Fix repo access (#476) (#477)

Backport #476

* fix repo access

* fix permission syncing

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
6543
2021-10-26 23:27:05 +02:00
committed by GitHub
co-authored by Anbraten
parent f585b23811
commit 3af5f99fb2
18 changed files with 276 additions and 13 deletions
@@ -36,6 +36,35 @@ INNER JOIN perms ON perms.perm_repo_id = repos.repo_id
WHERE perms.perm_user_id = ?
ORDER BY repo_full_name ASC
-- name: repo-find-user-owned
SELECT
repo_id
,repo_user_id
,repo_owner
,repo_name
,repo_full_name
,repo_avatar
,repo_link
,repo_clone
,repo_branch
,repo_timeout
,repo_private
,repo_trusted
,repo_active
,repo_allow_pr
,repo_hash
,repo_scm
,repo_config_path
,repo_gated
,repo_visibility
,repo_counter
FROM repos
INNER JOIN perms ON perms.perm_repo_id = repos.repo_id
WHERE perms.perm_user_id = ?
AND (perms.perm_push = 1 OR perms.perm_admin = 1)
ORDER BY repo_full_name ASC
-- name: repo-insert-ignore
INSERT OR IGNORE INTO repos (