diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-02-28 09:06:18 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-03-07 16:55:34 +0100 |
commit | e74879280f0cbf48fa0dcf8031e711cc51c9183f (patch) | |
tree | 291ec858063ba12d569b5a2810215d67b62195ac /app/policies/project_policy.rb | |
parent | c9557ad711c6cdf4465fb8c3c9b0dbaffcafa0e8 (diff) | |
download | gitlab-ce-e74879280f0cbf48fa0dcf8031e711cc51c9183f.tar.gz |
Allow maintainers to edit directly in a fork
Diffstat (limited to 'app/policies/project_policy.rb')
-rw-r--r-- | app/policies/project_policy.rb | 6 |
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? |