Class: Admin::TeamsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/teams_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_privilegeObject

put /admin/teams/:id/privileges/:privilege_id



16
17
18
19
20
# File 'app/controllers/admin/teams_controller.rb', line 16

def add_privilege
  link = @entity.add_privilege(@privilege)

  render json: { data: { link_id: link.id } }
end

#indexObject

get /admin/teams



6
7
8
# File 'app/controllers/admin/teams_controller.rb', line 6

def index
  @collection = Team.page_for_administration
end

#priorityObject

post /admin/teams/:id/priority



30
31
32
# File 'app/controllers/admin/teams_controller.rb', line 30

def priority
  render json: { data: @entity.change_priority(params[:delta].to_s.to_i) }
end

#remove_privilegeObject

delete /admin/teams/:id/privileges/:privilege_id



23
24
25
26
27
# File 'app/controllers/admin/teams_controller.rb', line 23

def remove_privilege
  @entity.remove_privilege(@privilege)

  head :no_content
end

#showObject

get /admin/teams/:id



11
12
13
# File 'app/controllers/admin/teams_controller.rb', line 11

def show
  @collection = Privilege.order('slug asc')
end