Class: Symphonia::RolesController

Inherits:
ApplicationController show all
Includes:
BaseController
Defined in:
app/controllers/symphonia/roles_controller.rb

Instance Method Summary collapse

Methods included from BaseController

#destroy, #edit, #index, #model_name, #new, #show

Methods included from ControllerExtensions

#admin_require, #authorize, #back_url, #current_user, #current_user_session, #handle_unverified_request, #login_require, #menu_item, #redirect_back_or_default, #redirect_to_referer_or, #render_403, #render_404, #render_api_head, #render_api_ok, #set_default_locale, #set_locale, #store_location

Instance Method Details

#createObject



18
19
20
21
22
# File 'app/controllers/symphonia/roles_controller.rb', line 18

def create
  @entity = @role = Role.new(entity_params)
  @role.permissions = Symphonia::Permissions.find_all(params[:permissions]).map(&:name)
  super
end

#modelObject



6
7
8
# File 'app/controllers/symphonia/roles_controller.rb', line 6

def model
  Role
end

#safe_attributesObject



10
11
12
# File 'app/controllers/symphonia/roles_controller.rb', line 10

def safe_attributes
  [:name, :description, permissions: []]
end

#updateObject



24
25
26
27
28
29
# File 'app/controllers/symphonia/roles_controller.rb', line 24

def update
  @entity = @role = Role.find(params[:id])
  @role.permissions = Symphonia::Permissions.find_all(params[:permissions]).map(&:name)
  super

end