summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-08-01 19:31:21 -0300
committerFelipe Artur <felipefac@gmail.com>2016-09-01 11:47:59 -0300
commit892dea67717c0efbd6a28f7639f34535ec0a8747 (patch)
tree83191c811b58de808da77f51aed63a1a021b2dcb /app/policies
parente71cd7a300017cf85e16de3b1c68fdb25c3a4b4d (diff)
downloadgitlab-ce-892dea67717c0efbd6a28f7639f34535ec0a8747.tar.gz
Project tools visibility level
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/project_policy.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index 15a9f2f0dca..acf36d422d1 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -145,28 +145,28 @@ class ProjectPolicy < BasePolicy
end
def disabled_features!
- unless project.issues_enabled
+ unless project.feature_available?(:issues, user)
cannot!(*named_abilities(:issue))
end
- unless project.merge_requests_enabled
+ unless project.feature_available?(:merge_requests, user)
cannot!(*named_abilities(:merge_request))
end
- unless project.issues_enabled || project.merge_requests_enabled
+ unless project.feature_available?(:issues, user) || project.feature_available?(:merge_requests, user)
cannot!(*named_abilities(:label))
cannot!(*named_abilities(:milestone))
end
- unless project.snippets_enabled
+ unless project.feature_available?(:snippets, user)
cannot!(*named_abilities(:project_snippet))
end
- unless project.has_wiki?
+ unless project.feature_available?(:wiki, user) || project.has_external_wiki?
cannot!(*named_abilities(:wiki))
end
- unless project.builds_enabled
+ unless project.feature_available?(:builds, user)
cannot!(*named_abilities(:build))
cannot!(*named_abilities(:pipeline))
cannot!(*named_abilities(:environment))