diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 00:05:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 00:05:58 +0000 |
commit | 1adb4373ba840a9bc771a8c9196f7183fd98b2b8 (patch) | |
tree | 1d319351302054fb1ca2223ed4da467fb2078765 /app/policies | |
parent | c324100967bbdd3f2f0ca3406c9261d35e69f148 (diff) | |
download | gitlab-ce-1adb4373ba840a9bc771a8c9196f7183fd98b2b8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_policy.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index ea2be37d7e6..ff70c6e6aeb 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -117,6 +117,10 @@ class ProjectPolicy < BasePolicy !@subject.builds_enabled? end + condition(:user_confirmed?) do + @user && @user.confirmed? + end + features = %w[ merge_requests issues @@ -249,10 +253,7 @@ class ProjectPolicy < BasePolicy enable :update_commit_status enable :create_build enable :update_build - enable :create_pipeline - enable :update_pipeline enable :read_pipeline_schedule - enable :create_pipeline_schedule enable :create_merge_request_from enable :create_wiki enable :push_code @@ -267,6 +268,12 @@ class ProjectPolicy < BasePolicy enable :update_release end + rule { can?(:developer_access) & user_confirmed? }.policy do + enable :create_pipeline + enable :update_pipeline + enable :create_pipeline_schedule + end + rule { can?(:maintainer_access) }.policy do enable :admin_board enable :push_to_delete_protected_branch @@ -418,7 +425,7 @@ class ProjectPolicy < BasePolicy # These rules are included to allow maintainers of projects to push to certain # to run pipelines for the branches they have access to. - rule { can?(:public_access) & has_merge_requests_allowing_pushes }.policy do + rule { can?(:public_access) & has_merge_requests_allowing_pushes & user_confirmed? }.policy do enable :create_build enable :create_pipeline end |