Gerret
Thanks *very* much for that. Think it would have taken me a while to
figure that one out!
Ian
On 15 Dec 2005, at 08:12, Gerret Apelt wrote:
> Hi Ian, I do this:
>
> def Controller < ActionController::Base
> before_filter { |c| c.role_required ''admin'' }
>
> def role_required(role)
> ...
> end
> end
>
> cheers,
> Gerret
>
> On 12/15/05, Ian J Cottee
<icottee-VRzI2sOoAJZhO+d2hxs5qQ@public.gmane.org> wrote:
>> I have a method that checks for a given role. I want to write
>> something in my controllers like
>>
>> before_filter :check_roles(''admin'')
>>
>> Which will ensure the current user has the admin role. Is it possible
>> to pass parameters in this way?
>>
>> Ian
>> _______________________________________________
>> Rails mailing list
>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails