Class: CantangoEditor::PermissionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CantangoEditor::PermissionsController
- Defined in:
- app/controllers/cantango_editor/permissions_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
- #new_category ⇒ Object
- #new_custom_target ⇒ Object
- #new_target ⇒ Object
- #preview_raw ⇒ Object
- #process_params ⇒ Object
- #update ⇒ Object
Instance Method Details
#index ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 6 def index @actions = Permissions.actions_available @models = Permissions.models_available @permission_types = Permissions. @permission_groups = Permissions. @permissions = Permissions.yml_file_content respond_to do |format| format.html format.js { render 'index.js.erb' } end end |
#new_category ⇒ Object
39 40 41 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 39 def new_category @new_categories_available = Categories.available_except(params[:existing_targets].to_a) end |
#new_custom_target ⇒ Object
32 33 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 32 def new_custom_target end |
#new_target ⇒ Object
35 36 37 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 35 def new_target @new_targets_available = Permissions.models_available_names - params[:existing_targets].to_a end |
#preview_raw ⇒ Object
43 44 45 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 43 def preview_raw @permissions_content = Permissions.raw_file_content end |
#process_params ⇒ Object
26 27 28 29 30 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 26 def process_params [:ptype, :pgroup, :can_action, :crud_action].each do |param| instance_variable_set("@#{param}", params[param]) end end |
#update ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/cantango_editor/permissions_controller.rb', line 19 def update Permissions. params index end |