diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 00:08:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 00:08:24 +0300 |
commit | 727b1a890c8e44440414c59611e9ead34d6edc93 (patch) | |
tree | de5f272452d2ee4d3e2edb90936fe7ecca127431 /app/finders | |
parent | aa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/sentry_issue_finder.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/finders/sentry_issue_finder.rb b/app/finders/sentry_issue_finder.rb new file mode 100644 index 00000000000..8b3e7105211 --- /dev/null +++ b/app/finders/sentry_issue_finder.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SentryIssueFinder + attr_accessor :project, :current_user + + def initialize(project, current_user: nil) + @project = project + @current_user = current_user + end + + def execute(identifier) + return unless authorized? + + SentryIssue + .for_project_and_identifier(project, identifier) + end + + private + + def authorized? + Ability.allowed?(current_user, :read_sentry_issue, project) + end +end |