mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 04:53:58 +08:00
c243861b17
https://meta.discourse.org/t/error-when-pressing-send-activitation-email-when-must-approve-users-setting-is-enabled/65408
36 lines
762 B
Ruby
36 lines
762 B
Ruby
require_dependency 'admin_user_list_serializer'
|
|
|
|
class AdminUserSerializer < AdminUserListSerializer
|
|
|
|
attributes :name,
|
|
:associated_accounts,
|
|
:can_send_activation_email,
|
|
:can_activate,
|
|
:can_deactivate,
|
|
:ip_address,
|
|
:registration_ip_address
|
|
|
|
has_one :single_sign_on_record, serializer: SingleSignOnRecordSerializer, embed: :objects
|
|
|
|
def can_send_activation_email
|
|
scope.can_send_activation_email?(object)
|
|
end
|
|
|
|
def can_activate
|
|
scope.can_activate?(object)
|
|
end
|
|
|
|
def can_deactivate
|
|
scope.can_deactivate?(object)
|
|
end
|
|
|
|
def ip_address
|
|
object.ip_address.try(:to_s)
|
|
end
|
|
|
|
def registration_ip_address
|
|
object.registration_ip_address.try(:to_s)
|
|
end
|
|
|
|
end
|