BigW Consortium Gitlab

group.rb 1.71 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]
Felipe Artur committed
15
  resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :new, :create] do
16 17 18 19 20 21
    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
Shinya Maeda committed
26

27 28 29 30
  scope path: '-' do
    namespace :settings do
      resource :ci_cd, only: [:show], controller: 'ci_cd'
    end
Shinya Maeda committed
31

32 33
    resources :variables, only: [:index, :show, :update, :create, :destroy]
  end
34
end
35

36 37
scope(path: 'groups/*id',
      controller: :groups,
38
      constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
39 40 41 42 43
  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
44
  get :subgroups, as: :subgroups_group
45
  get '/', action: :show, as: :group_canonical
46
end
47 48 49 50 51 52 53 54 55 56 57 58

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