2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00
discourse/app/serializers/web_hook_user_serializer.rb

20 lines
346 B
Ruby

class WebHookUserSerializer < UserSerializer
attributes :external_id
# remove staff attributes
def staff_attributes(*attrs)
end
def include_email?
scope.is_admin?
end
def include_external_id?
scope.is_admin? && object.single_sign_on_record
end
def external_id
object.single_sign_on_record.external_id
end
end