initial_state_presenter.rb 441 B

123456789101112131415
  1. # frozen_string_literal: true
  2. class InitialStatePresenter < ActiveModelSerializers::Model
  3. attributes :settings, :push_subscription, :token,
  4. :current_account, :admin, :owner, :text, :visibility,
  5. :disabled_account, :moved_to_account, :critical_updates_pending
  6. def role
  7. current_account&.user_role
  8. end
  9. def critical_updates_pending
  10. role&.can?(:view_devops) && SoftwareUpdate.urgent_pending?
  11. end
  12. end