diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-09-16 16:15:39 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-10-17 18:12:18 -0200 |
commit | da07c2e4d3d382c05ec287ee60f639b870074fe7 (patch) | |
tree | f6ffa7fd29fe177d4d78c0e043a1fdcff5b6eba4 /app/policies | |
parent | c49e152605ad1fe77bea6414c383cf70669ca110 (diff) | |
download | gitlab-ce-da07c2e4d3d382c05ec287ee60f639b870074fe7.tar.gz |
Add visibility level to project repositoryissue_19734_2
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_policy.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index be4721d7a51..fbb3d4507d6 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -162,11 +162,13 @@ class ProjectPolicy < BasePolicy end def disabled_features! + repository_enabled = project.feature_available?(:repository, user) + unless project.feature_available?(:issues, user) cannot!(*named_abilities(:issue)) end - unless project.feature_available?(:merge_requests, user) + unless project.feature_available?(:merge_requests, user) && repository_enabled cannot!(*named_abilities(:merge_request)) end @@ -183,13 +185,21 @@ class ProjectPolicy < BasePolicy cannot!(*named_abilities(:wiki)) end - unless project.feature_available?(:builds, user) + unless project.feature_available?(:builds, user) && repository_enabled cannot!(*named_abilities(:build)) cannot!(*named_abilities(:pipeline)) cannot!(*named_abilities(:environment)) cannot!(*named_abilities(:deployment)) end + unless repository_enabled + cannot! :push_code + cannot! :push_code_to_protected_branches + cannot! :download_code + cannot! :fork_project + cannot! :read_commit_status + end + unless project.container_registry_enabled cannot!(*named_abilities(:container_image)) end |