summaryrefslogtreecommitdiff
path: root/app/policies/issue_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/issue_policy.rb')
-rw-r--r--app/policies/issue_policy.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb
index 053243e2296..74bed6b6c4e 100644
--- a/app/policies/issue_policy.rb
+++ b/app/policies/issue_policy.rb
@@ -15,6 +15,9 @@ class IssuePolicy < IssuablePolicy
desc "Issue is confidential"
condition(:confidential, scope: :subject) { @subject.confidential? }
+ desc "Issue is hidden"
+ condition(:hidden, scope: :subject) { @subject.hidden? }
+
desc "Issue is persisted"
condition(:persisted, scope: :subject) { @subject.persisted? }
@@ -23,6 +26,10 @@ class IssuePolicy < IssuablePolicy
prevent :read_issue_iid
end
+ rule { hidden & ~admin }.policy do
+ prevent :read_issue
+ end
+
rule { ~can?(:read_issue) }.prevent :create_note
rule { locked }.policy do