Class: Subscriptions::WorkItemUpdated

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

Instance Method Summary collapse

Methods included from Gitlab::Graphql::Laziness

#defer, #force

Methods inherited from BaseSubscription

#initialize, #subscribe

Constructor Details

This class inherits a constructor from Subscriptions::BaseSubscription

Instance Method Details

#authorized?(work_item_id:) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'app/graphql/subscriptions/work_item_updated.rb', line 13

def authorized?(work_item_id:)
  work_item = force(GitlabSchema.find_by_gid(work_item_id))

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

  true
end