Class: Api::RolesController
Instance Method Summary
collapse
#ensure_base_organization!
#organization_name, #set_current_organization!, #visit_organization!
#authorization_slug, #authorize_janitor!, #authorize_owner!, #protection_slug
Instance Method Details
#attach ⇒ Object
14
15
16
17
|
# File 'app/controllers/api/roles_controller.rb', line 14
def attach
@user.attach! role, @course
head :ok
end
|
#create ⇒ Object
8
9
10
11
12
|
# File 'app/controllers/api/roles_controller.rb', line 8
def create
@user = User.create_if_necessary(user_params)
@user.attach! role, @course
render json: @user
end
|
#detach ⇒ Object
19
20
21
22
|
# File 'app/controllers/api/roles_controller.rb', line 19
def detach
@user.detach! role, @course
head :ok
end
|