debian-mirror-gitlab/app/serializers/admin/user_entity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
651 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# 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-03-11 19:13:27 +05:30
expose :note
2021-02-22 17:27:13 +05:30
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-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
Admin::UserEntity.prepend_mod_with('Admin::UserEntity')