Class: Subscriptions::IssuableUpdated

Inherits:
BaseSubscription
  • Object
show all
Includes:
Gitlab::Graphql::Laziness
Defined in:
app/graphql/subscriptions/issuable_updated.rb

Instance Method Summary collapse

Methods included from Gitlab::Graphql::Laziness

#defer, #force

Methods inherited from BaseSubscription

#initialize

Constructor Details

This class inherits a constructor from Subscriptions::BaseSubscription

Instance Method Details

#authorized?(issuable_id:) ⇒ Boolean

Returns:

  • (Boolean)

Raises:


17
18
19
20
21
22
23
24
25
26
27
# File 'app/graphql/subscriptions/issuable_updated.rb', line 17

def authorized?(issuable_id:)
  # TODO: remove this check when the compatibility layer is removed
  # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
  raise Gitlab::Graphql::Errors::ArgumentError, 'Invalid IssuableID' unless issuable_id.is_a?(GlobalID)

  issuable = force(GitlabSchema.find_by_gid(issuable_id))

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

  true
end

#subscribe(issuable_id:) ⇒ Object


13
14
15
# File 'app/graphql/subscriptions/issuable_updated.rb', line 13

def subscribe(issuable_id:)
  nil
end