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/finders/ci/triggers_finder.rb')
-rw-r--r--app/finders/ci/triggers_finder.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/finders/ci/triggers_finder.rb b/app/finders/ci/triggers_finder.rb
new file mode 100644
index 00000000000..a4b429539d6
--- /dev/null
+++ b/app/finders/ci/triggers_finder.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Ci
+ class TriggersFinder
+ def initialize(current_user, project)
+ @current_user = current_user
+ @project = project
+ end
+
+ def execute
+ return Ci::Trigger.none unless Ability.allowed?(@current_user, :admin_build, @project)
+
+ @project.triggers
+ end
+ end
+end