Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-02-28 11:06:18 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-03-07 18:55:34 +0300
commite74879280f0cbf48fa0dcf8031e711cc51c9183f (patch)
tree291ec858063ba12d569b5a2810215d67b62195ac /app/policies
parentc9557ad711c6cdf4465fb8c3c9b0dbaffcafa0e8 (diff)
Allow maintainers to edit directly in a fork
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/project_policy.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index ce94a25a20b..e143a32e350 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -307,6 +307,12 @@ class ProjectPolicy < BasePolicy
enable :update_pipeline
end
+ # A wrapper around `push_code` and `push_single_branch` to avoid several
+ # `push_code`: User can push everything to the repo
+ # `push_single_brach`: User can push to a single branch in the repo
+ # `push_to_repo`: User can push something to this repo.
+ rule { can?(:push_code) | can?(:push_single_branch) }.enable :push_to_repo
+
private
def team_member?