1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
This commit is contained in:
Emelia Smith 2024-07-27 17:40:54 +02:00
parent 48fafc7389
commit 08235a8da7
No known key found for this signature in database
4 changed files with 11 additions and 6 deletions

View file

@ -10,7 +10,7 @@ class InitialStateSerializer < ActiveModel::Serializer
attribute :critical_updates_pending, if: -> { object&.role&.can?(:view_devops) && SoftwareUpdate.check_enabled? }
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
has_one :role, serializer: REST::RoleSerializer
has_one :role, serializer: REST::CredentialRoleSerializer
def meta
store = default_meta_store

View file

@ -11,7 +11,7 @@ class REST::Admin::AccountSerializer < ActiveModel::Serializer
has_many :ips, serializer: REST::Admin::IpSerializer
has_one :account, serializer: REST::AccountSerializer
has_one :role, serializer: REST::RoleSerializer
has_one :role, serializer: REST::CredentialRoleSerializer
def id
object.id.to_s

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class REST::CredentialRoleSerializer < REST::RoleSerializer
attributes :permissions
def permissions
object.computed_permissions.to_s
end
end

View file

@ -6,8 +6,4 @@ class REST::RoleSerializer < ActiveModel::Serializer
def id
object.id.to_s
end
def permissions
object.computed_permissions.to_s
end
end