Class: BsmOa::AuthorizationsController
- Inherits:
-
AdminController
- Object
- BaseController
- AdminController
- BsmOa::AuthorizationsController
- Defined in:
- app/controllers/bsm_oa/authorizations_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #toggle ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
29 30 31 32 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 29 def create @authorization = resource_scope.create permitted_params respond_with @authorization end |
#destroy ⇒ Object
46 47 48 49 50 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 46 def destroy @authorization = resource_scope.find params[:id] @authorization.destroy respond_with @authorization, location: @authorization.role end |
#edit ⇒ Object
24 25 26 27 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 24 def edit @authorization = resource_scope.find params[:id] respond_with @authorization end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 9 def index @authorizations = apply_scopes(resource_scope) respond_with @authorizations end |
#new ⇒ Object
19 20 21 22 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 19 def new @authorization = resource_scope.new respond_with @authorization end |
#show ⇒ Object
14 15 16 17 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 14 def show @authorization = resource_scope.find params[:id] respond_with @authorization end |
#toggle ⇒ Object
40 41 42 43 44 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 40 def toggle @authorization = resource_scope.find params[:id] @authorization.(params[:permission]) respond_with @authorization end |
#update ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/bsm_oa/authorizations_controller.rb', line 34 def update @authorization = resource_scope.find params[:id] @authorization.update(permitted_params) respond_with @authorization end |