avatar_updates.rb 561 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Subscriptions
  3. class User::Current::AvatarUpdates < BaseSubscription
  4. description 'Updates to account avatar records'
  5. subscription_scope :current_user_id
  6. field :avatars, [Gql::Types::AvatarType], null: true, description: 'List of avatars for the user'
  7. def authorized?
  8. context.current_user.permissions?('user_preferences.avatar')
  9. end
  10. def update
  11. { avatars: Avatar.list('User', context.current_user.id, raw: true) }
  12. end
  13. end
  14. end