Class: Subscriptions::Notes::Base
- Inherits:
-
BaseSubscription
- Object
- GraphQL::Schema::Subscription
- BaseSubscription
- Subscriptions::Notes::Base
- Includes:
- Gitlab::Graphql::Laziness
- Defined in:
- app/graphql/subscriptions/notes/base.rb
Constant Summary
Constants inherited from BaseSubscription
BaseSubscription::UNAUTHORIZED_ERROR_MESSAGE
Instance Method Summary collapse
Methods included from Gitlab::Graphql::Laziness
Methods inherited from BaseSubscription
Constructor Details
This class inherits a constructor from Subscriptions::BaseSubscription
Instance Method Details
#authorized?(noteable_id:) ⇒ Boolean
12 13 14 15 16 17 18 19 20 |
# File 'app/graphql/subscriptions/notes/base.rb', line 12 def (noteable_id:) noteable = force(GitlabSchema.find_by_gid(noteable_id)) # unsubscribe if user cannot read the noteable anymore for any reason, e.g. issue was set confidential, # in the meantime the read note permissions is checked within its corresponding returned type, i.e. NoteType unless noteable && Ability.allowed?(current_user, :"read_#{noteable.to_ability_name}", noteable) true end |