BigW Consortium Gitlab

group_entity.rb 411 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class GroupEntity < Grape::Entity
  include RequestAwareEntity

  expose :id, :name, :path, :description, :visibility
  expose :avatar_url
  expose :web_url
  expose :full_name, :full_path
  expose :parent_id
  expose :created_at, :updated_at

  expose :permissions do
    expose :group_access do |group, options|
      group.group_members.find_by(user_id: request.current_user)&.access_level
    end
  end
end