diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-29 20:12:45 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-29 20:12:45 +0000 |
commit | cdba3fe8705bdde82b60a85882f4ae273634e987 (patch) | |
tree | 7b34c7838547628d2aec88fa5ae2ef7030497341 /app/policies/project_policy.rb | |
parent | 713a1e283346dd98c14f362bdff4712ca8f6d67d (diff) | |
parent | f9963fe029122c9d7e866368b1fc1218e071f9d6 (diff) | |
download | gitlab-ce-cdba3fe8705bdde82b60a85882f4ae273634e987.tar.gz |
Merge branch 'issue_25682' into 'master'
Parse JIRA issue references even if Issue Tracker is disabled
Closes #25682
See merge request !8238
Diffstat (limited to 'app/policies/project_policy.rb')
-rw-r--r-- | app/policies/project_policy.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index eaf3035dfe1..71ef8901932 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -171,9 +171,7 @@ class ProjectPolicy < BasePolicy def disabled_features! repository_enabled = project.feature_available?(:repository, user) - unless project.feature_available?(:issues, user) - cannot!(*named_abilities(:issue)) - end + block_issues_abilities unless project.feature_available?(:merge_requests, user) && repository_enabled cannot!(*named_abilities(:merge_request)) @@ -250,6 +248,15 @@ class ProjectPolicy < BasePolicy ) end + def block_issues_abilities + unless project.feature_available?(:issues, user) + cannot! :read_issue if project.default_issues_tracker? + cannot! :create_issue + cannot! :update_issue + cannot! :admin_issue + end + end + def named_abilities(name) [ :"read_#{name}", |