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:
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