Commit 5f38f672 authored by Nihad Abbasov's avatar Nihad Abbasov

don't expose full user info unless needed

parent 61910eb8
...@@ -5,9 +5,13 @@ module Gitlab ...@@ -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 ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment