diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-26 18:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-26 18:08:47 +0000 |
commit | 3cf907da69b58dd56121b44fc2a95bd0ce197ea2 (patch) | |
tree | 1a6e8d0f3163b4844fd992d0bb41acc93bf7d66e /lib/api/entities.rb | |
parent | 1a18b430890a59ad846deed3a8e88f54e9db4c35 (diff) | |
download | gitlab-ce-3cf907da69b58dd56121b44fc2a95bd0ce197ea2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 872432f0cd7..62eb30f2edf 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -11,69 +11,10 @@ module API expose :access_level end - class UserSafe < Grape::Entity - expose :id, :name, :username - end - - class UserBasic < UserSafe - expose :state - - expose :avatar_url do |user, options| - user.avatar_url(only_path: false) - end - - expose :avatar_path, if: ->(user, options) { options.fetch(:only_path, false) && user.avatar_path } - expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes - - expose :web_url do |user, options| - Gitlab::Routing.url_helpers.user_url(user) - end - end - - class User < UserBasic - expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } - expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization - end - - class UserActivity < Grape::Entity - expose :username - expose :last_activity_on - expose :last_activity_on, as: :last_activity_at # Back-compat - end - - class UserStarsProject < Grape::Entity - expose :starred_since - expose :user, using: Entities::UserBasic - end - class Identity < Grape::Entity expose :provider, :extern_uid end - class UserPublic < User - expose :last_sign_in_at - expose :confirmed_at - expose :last_activity_on - expose :email - expose :theme_id, :color_scheme_id, :projects_limit, :current_sign_in_at - expose :identities, using: Entities::Identity - expose :can_create_group?, as: :can_create_group - expose :can_create_project?, as: :can_create_project - expose :two_factor_enabled?, as: :two_factor_enabled - expose :external - expose :private_profile - end - - class UserWithAdmin < UserPublic - expose :admin?, as: :is_admin - end - - class UserDetailsWithAdmin < UserWithAdmin - expose :highest_role - expose :current_sign_in_ip - expose :last_sign_in_ip - end - class UserStatus < Grape::Entity expose :emoji expose :message |