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

issuable_updated.rb « subscriptions « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63fe81bbc326fea4902a0cb4f093d69eebebafcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Subscriptions
  class IssuableUpdated < BaseSubscription
    include Gitlab::Graphql::Laziness

    payload_type Types::IssuableType

    argument :issuable_id, Types::GlobalIDType[Issuable],
              required: true,
              description: 'ID of the issuable.'

    def authorized?(issuable_id:)
      issuable = force(GitlabSchema.find_by_gid(issuable_id))

      unauthorized! unless issuable && Ability.allowed?(current_user, :"read_#{issuable.to_ability_name}", issuable)

      true
    end
  end
end