Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-12 00:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-12 00:09:00 +0300
commitbf217da41b429d80da49287b84dadcbf499ac22c (patch)
treeb3499733d7e1abb88a3f0975333c85d00a80fd96 /app/policies/event_policy.rb
parent559d99e40299e67969023a1afd23d084fbf23ed1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/event_policy.rb')
-rw-r--r--app/policies/event_policy.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/policies/event_policy.rb b/app/policies/event_policy.rb
new file mode 100644
index 00000000000..5587956855e
--- /dev/null
+++ b/app/policies/event_policy.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class EventPolicy < BasePolicy # rubocop:disable Gitlab/NamespacedClass
+ condition(:visible_to_user) do
+ subject.visible_to_user?(user)
+ end
+
+ rule { visible_to_user }.enable :read_event
+end