BigW Consortium Gitlab

group.rb 1.16 KB
Newer Older
1 2 3
require 'constraints/group_url_constrainer'

constraints(GroupUrlConstrainer.new) do
4 5
  scope(path: ':id',
        as: :group,
6
        constraints: { id: Gitlab::Regex.namespace_route_regex },
7
        controller: :groups) do
8
    get '/', action: :show
9 10 11
    patch '/', action: :update
    put '/', action: :update
    delete '/', action: :destroy
12 13 14
  end
end

15
resources :groups, only: [:index, :new, :create]
16

17 18 19 20 21 22 23
scope(path: 'groups/:id', controller: :groups) do
  get :edit, as: :edit_group
  get :issues, as: :issues_group
  get :merge_requests, as: :merge_requests_group
  get :projects, as: :projects_group
  get :activity, as: :activity_group
end
24

25 26 27 28
scope(path: 'groups/:group_id', module: :groups, as: :group) do
  resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
    post :resend_invite, on: :member
    delete :leave, on: :collection
29
  end
30 31 32 33

  resource :avatar, only: [:destroy]
  resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
  resources :labels, except: [:show], constraints: { id: /\d+/ }
34
end
35 36 37

# Must be last route in this file
get 'groups/:id' => 'groups#show', as: :group_canonical