Method: Authengine::ActionsController#index

Defined in:
app/controllers/authengine/actions_controller.rb

#indexObject



4
5
6
7
8
9
10
# File 'app/controllers/authengine/actions_controller.rb', line 4

def index
  Controller.update_table # make sure the actions table includes all current controllers/actions
  @actions = Action.all(:include=>:controller).sort
  @roles = Role.all(:include=>{:actions=>:controller}, :order=>:name) # this eager loading seems to produce a large number of database accesses, and I'm not sure why!!
  @allowed = []
  @roles.each{ |r| @allowed[r.id]= r.name=="developer" ? @actions.map(&:id) : r.actions.map{ |a| a.id unless a.nil? } }
end