Class: Dscf::Core::RolePermissionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Dscf::Core::RolePermissionsController
- Defined in:
- app/controllers/dscf/core/role_permissions_controller.rb
Instance Method Summary collapse
Methods included from Authorizable
#authorize, #authorize_action!, #policy_scope, #pundit_user
Methods included from JsonResponse
#render_error, #render_success, #serialize
Methods included from TokenAuthenticatable
#require_valid_refresh_token, #validate_device_consistency, #validate_token_expiry
Methods included from Authenticatable
#authenticate_user, #authenticate_user!, #current_user, #refresh_token, #sign_in, #sign_out
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/dscf/core/role_permissions_controller.rb', line 13 def create @clazz = Dscf::Core::RolePermission = Dscf::Core::RolePermission.new( role: @role, permission_id: params[:permission_id] ) if .save render_success(data: , status: :created) else render_error(errors: .errors.[0], status: :unprocessable_entity) end end |
#destroy ⇒ Object
28 29 30 31 32 |
# File 'app/controllers/dscf/core/role_permissions_controller.rb', line 28 def destroy @clazz = Dscf::Core::RolePermission @role_permission.destroy render_success end |
#index ⇒ Object
8 9 10 11 |
# File 'app/controllers/dscf/core/role_permissions_controller.rb', line 8 def index @clazz = Dscf::Core::RolePermission render_success(data: @role.) end |