Commit 5f38f67247786988c8fa1d86fe0afdd411360b27
1 parent
61910eb8
Exists in
master
and in
4 other branches
don't expose full user info unless needed
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
lib/api/entities.rb
| ... | ... | @@ -5,9 +5,13 @@ module Gitlab |
| 5 | 5 | :dark_scheme, :theme_id, :blocked, :created_at |
| 6 | 6 | end |
| 7 | 7 | |
| 8 | + class UserBasic < Grape::Entity | |
| 9 | + expose :id, :email, :name, :blocked, :created_at | |
| 10 | + end | |
| 11 | + | |
| 8 | 12 | class Project < Grape::Entity |
| 9 | 13 | expose :id, :code, :name, :description, :path, :default_branch |
| 10 | - expose :owner, :using => Entities::User | |
| 14 | + expose :owner, :using => Entities::UserBasic | |
| 11 | 15 | expose :private_flag, :as => :private |
| 12 | 16 | expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at |
| 13 | 17 | end |
| ... | ... | @@ -22,7 +26,7 @@ module Gitlab |
| 22 | 26 | |
| 23 | 27 | class ProjectSnippet < Grape::Entity |
| 24 | 28 | expose :id, :title, :file_name |
| 25 | - expose :author, :using => Entities::User | |
| 29 | + expose :author, :using => Entities::UserBasic | |
| 26 | 30 | expose :expires_at, :updated_at, :created_at |
| 27 | 31 | end |
| 28 | 32 | end | ... | ... |