Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group_child_entity.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0d2052fe6f3c50feeaf10017541fa26f771380ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class GroupChildEntity < Grape::Entity
  include ActionView::Helpers::NumberHelper
  include RequestAwareEntity

  expose :id, :name, :description, :visibility, :full_name, :full_path, :web_url,
         :created_at, :updated_at, :star_count, :can_edit, :type, :parent_id,
         :children_count, :leave_path, :edit_path, :number_projects_with_delimiter,
         :number_users_with_delimiter, :permissions, :star_count

  def type
    object.class.name.downcase
  end

  def can_edit
    return false unless request.respond_to?(:current_user)

    can?(request.current_user, "edit_{type}", object)
  end
  expose
end