diff options
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index c3c351e1733..7b35f5f529f 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -40,6 +40,18 @@ module API end end + class TeamMember < UserBasic + expose :permission, as: :access_level do |user, options| + options[:user_team].user_team_user_relationships.find_by_user_id(user.id).permission + end + end + + class TeamProject < Project + expose :greatest_access, as: :greatest_access_level do |project, options| + options[:user_team].user_team_project_relationships.find_by_project_id(project.id).greatest_access + end + end + class Group < Grape::Entity expose :id, :name, :path, :owner_id end @@ -87,6 +99,10 @@ module API expose :id, :title, :key, :created_at end + class UserTeam < Grape::Entity + expose :id, :name, :path, :owner_id + end + class MergeRequest < Grape::Entity expose :id, :target_branch, :source_branch, :project_id, :title, :state expose :author, :assignee, using: Entities::UserBasic |