2017-07-08 08:51:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class InitialStatePresenter < ActiveModelSerializers::Model
|
2017-08-13 22:53:31 -04:00
|
|
|
attributes :settings, :push_subscription, :token,
|
2022-11-05 13:28:13 -04:00
|
|
|
:current_account, :admin, :owner, :text, :visibility,
|
2023-09-01 11:47:07 -04:00
|
|
|
:disabled_account, :moved_to_account, :critical_updates_pending
|
2022-07-04 20:41:40 -04:00
|
|
|
|
|
|
|
def role
|
|
|
|
current_account&.user_role
|
|
|
|
end
|
2023-09-01 11:47:07 -04:00
|
|
|
|
|
|
|
def critical_updates_pending
|
|
|
|
role&.can?(:view_devops) && SoftwareUpdate.urgent_pending?
|
|
|
|
end
|
2017-07-08 08:51:05 -04:00
|
|
|
end
|