2020-12-04 19:10:01 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class UserEntity < API::Entities::UserSafe
|
|
|
|
include RequestAwareEntity
|
|
|
|
include UsersHelper
|
|
|
|
include UserActionsHelper
|
|
|
|
|
|
|
|
expose :created_at
|
|
|
|
expose :email
|
|
|
|
expose :last_activity_on
|
|
|
|
expose :avatar_url
|
2021-02-01 16:09:15 -05:00
|
|
|
expose :note
|
2020-12-04 19:10:01 -05:00
|
|
|
expose :badges do |user|
|
|
|
|
user_badges_in_admin_section(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :projects_count do |user|
|
|
|
|
user.authorized_projects.length
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :actions do |user|
|
|
|
|
admin_actions(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def current_user
|
|
|
|
options[:current_user]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-04-13 20:10:39 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
Admin::UserEntity.prepend_mod_with('Admin::UserEntity')
|