BigW Consortium Gitlab

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

3
resources :groups, only: [:index, :new, :create]
4

5
scope(path: 'groups/*group_id',
6 7
      module: :groups,
      as: :group,
8
      constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do
9 10 11
  resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
    post :resend_invite, on: :member
    delete :leave, on: :collection
12
  end
13 14

  resource :avatar, only: [:destroy]
15 16 17 18 19 20 21
  resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create] do
    member do
      get :merge_requests
      get :participants
      get :labels
    end
  end
22

23
  resources :labels, except: [:show] do
24 25
    post :toggle_subscription, on: :member
  end
26
end
27

28 29
scope(path: 'groups/*id',
      controller: :groups,
30
      constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
31 32 33 34 35
  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
36
  get :subgroups, as: :subgroups_group
37
  get '/', action: :show, as: :group_canonical
38
end
39 40 41 42 43 44 45 46 47 48 49 50

constraints(GroupUrlConstrainer.new) do
  scope(path: '*id',
        as: :group,
        constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ },
        controller: :groups) do
    get '/', action: :show
    patch '/', action: :update
    put '/', action: :update
    delete '/', action: :destroy
  end
end