Commit 78faeab8 authored by Stan Hu's avatar Stan Hu

Fix regression in Git Annex permission check

The `changes` in git-annex-shell mean a different thing than
git-receive-pack. Revert to the previous code and use a simple check
whether Git Annex is enabled.
parent 5fc31b1d
...@@ -4,6 +4,7 @@ v 8.11.0 (unreleased) ...@@ -4,6 +4,7 @@ v 8.11.0 (unreleased)
- Performance improvement of push rules - Performance improvement of push rules
v 8.10.3 (unreleased) v 8.10.3 (unreleased)
- Fix regression in Git Annex permission check
v 8.10.2 v 8.10.2
- Fix pagination on search result page when ES search is enabled. !592 - Fix pagination on search result page when ES search is enabled. !592
......
...@@ -253,6 +253,8 @@ module Gitlab ...@@ -253,6 +253,8 @@ module Gitlab
end end
def git_annex_access_check(project, changes) def git_annex_access_check(project, changes)
return false unless Gitlab.config.gitlab_shell.git_annex_enabled
unless user && user_access.allowed? unless user && user_access.allowed?
return build_status_object(false, "You don't have access") return build_status_object(false, "You don't have access")
end end
...@@ -265,7 +267,7 @@ module Gitlab ...@@ -265,7 +267,7 @@ module Gitlab
return build_status_object(false, "You can't use git-annex with a secondary GitLab Geo node.") return build_status_object(false, "You can't use git-annex with a secondary GitLab Geo node.")
end end
if user.can?(:push_code, project) && git_annex_branch_sync?(changes) if user.can?(:push_code, project)
build_status_object(true) build_status_object(true)
else else
build_status_object(false, "You don't have permission") build_status_object(false, "You don't have permission")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment