Re: Controller filter parameters

Eloy Duran
Mon, 02 Nov 2009 15:05:22 -0000

Hey Rodrigo,

> Hi Eloy, thank you for your suggestion, but I don''t think it would
> satisfy my needs...
>
> In my case, a user has a role that can be attached to some conditions.
> For instance, the user ''manager'' has a role
''institution_admin'' only
> for
> institution ''manager_institution''...

I don''t completely follow the explanation of the example, but that
would probably be easy with authorization-san. It already supports the
idea of ''role'' on an object.
In all the projects we have used it, we haven''t found one scenario
that we couldn''t solve.

class InstitutionsController < ActionController::Base
   allow_access :institution_admin do
     # perform any checks and return truthy or falsy value
   end
end

> But anyway, that was just an example. I was really curious about
> filters
> supporting parameters directly.

I''m not sure there is any reason to, since like I said we have been
able to solve all situations we''ve come across.

Besides that, I''m not sure that I find the examples you gave of how it
would look like to be readable/understandable. Maybe it''s the example,
maybe it''s me…

Cheers,
Eloy