Class RightController
In: app/controllers/right_controller.rb
Parent: ApplicationController

Methods

Public Instance methods

 You must be logged in to use all functions except #login

before_filter :authorize

[Source]

    # File app/controllers/right_controller.rb, line 7
 7:   def add_right_for_admin
 8: 
 9:     if !Right.find_by_name(params[:right_controller] + " " + params[:right_action])
10:       role = Role.find_by_name("Administrator")
11:       right = Right.create(:name => params[:right_controller] + " " + params[:right_action], :controller => params[:right_controller], :action => params[:right_action])
12:       role.rights << right
13:     end
14:     flash[:notice] = 'Admin Right was successfully updated.'
15:     redirect_to :action => params[:right_action], :controller => params[:right_controller]
16:   end

[Source]

    # File app/controllers/right_controller.rb, line 18
18:   def add_right_for_user
19: 
20:     if !Right.find_by_name(params[:right_controller] + " " + params[:right_action])
21:       role = Role.find_by_name("User")
22:       right = Right.create(:name => params[:right_controller] + " " + params[:right_action], :controller => params[:right_controller], :action => params[:right_action])
23:       role.rights << right
24:     end
25:     flash[:notice] = 'User Right was successfully updated.'
26:     redirect_to :action => params[:right_action], :controller => params[:right_controller]
27:   end

[Validate]