~cytrogen/masto-fe

ref: 16681e0f20e1f8584e11439953c8d59b322571f5 masto-fe/app/presenters/initial_state_presenter.rb -rw-r--r-- 441 bytes
16681e0f — Claire Add admin notifications for new Mastodon versions (#26582) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class InitialStatePresenter < ActiveModelSerializers::Model
  attributes :settings, :push_subscription, :token,
             :current_account, :admin, :owner, :text, :visibility,
             :disabled_account, :moved_to_account, :critical_updates_pending

  def role
    current_account&.user_role
  end

  def critical_updates_pending
    role&.can?(:view_devops) && SoftwareUpdate.urgent_pending?
  end
end