re: Controller filter parameters

Hi Rodrigo,

The boolean accessors on the User model could probably be refactored,
but you get the idea.

   class User < ActiveRecord::Base
     has_many :roles

     def institution_admin?
       roles.any? { |r| r.label == 'institution_admin' }

     def system_admin?
       roles.any? { |r| r.label == 'system_admin' }

   class InstitutionController
     allow_accesss(:institution_admin) do
       @authenticated.institution == @institution

     prepend_before_filter :find_institution


     def find_institution
       @institution = Institution.find(params[:id])

Can we continue this discussion on Ruby on Rails: Talk? This list is
meant for discussions about Ruby on Rails core development.