don't expose full user info unless needed
This commit is contained in:
parent
61910eb8fa
commit
5f38f67247
1 changed files with 6 additions and 2 deletions
|
@ -5,9 +5,13 @@ module Gitlab
|
||||||
:dark_scheme, :theme_id, :blocked, :created_at
|
:dark_scheme, :theme_id, :blocked, :created_at
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class UserBasic < Grape::Entity
|
||||||
|
expose :id, :email, :name, :blocked, :created_at
|
||||||
|
end
|
||||||
|
|
||||||
class Project < Grape::Entity
|
class Project < Grape::Entity
|
||||||
expose :id, :code, :name, :description, :path, :default_branch
|
expose :id, :code, :name, :description, :path, :default_branch
|
||||||
expose :owner, :using => Entities::User
|
expose :owner, :using => Entities::UserBasic
|
||||||
expose :private_flag, :as => :private
|
expose :private_flag, :as => :private
|
||||||
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at
|
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at
|
||||||
end
|
end
|
||||||
|
@ -22,7 +26,7 @@ module Gitlab
|
||||||
|
|
||||||
class ProjectSnippet < Grape::Entity
|
class ProjectSnippet < Grape::Entity
|
||||||
expose :id, :title, :file_name
|
expose :id, :title, :file_name
|
||||||
expose :author, :using => Entities::User
|
expose :author, :using => Entities::UserBasic
|
||||||
expose :expires_at, :updated_at, :created_at
|
expose :expires_at, :updated_at, :created_at
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue