out_of_office.rb 697 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class User::Current::OutOfOffice < BaseMutation
  4. description 'Update user profile out of office settings'
  5. argument :input, Gql::Types::Input::OutOfOfficeInputType, description: 'Out of Office settings'
  6. field :success, Boolean, description: 'Profile out of office settings updated successfully?'
  7. def self.authorize(_obj, ctx)
  8. ctx.current_user.permissions?('user_preferences.out_of_office+ticket.agent')
  9. end
  10. def resolve(input:)
  11. Service::User::OutOfOffice
  12. .new(context.current_user, **input)
  13. .execute
  14. { success: true }
  15. end
  16. end
  17. end