Hi, I have this before filter on my application controller for authentication purposes: class ApplicationController < ActionController::Base before_filter :check_authentication, :check_authorization, :except => [:authentication, :login, :logout] However, I have some controllers that I don''t even want authenticated. And as I understand it, expect only takes actions as parameters. How can I exclude based on controllers? I''m starting to think my authentication model isn''t very flexible. It''s roles and rights recipe from the prag prog rails recipies book. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe I should move my authentication before_filter check to only the controllers I want to guard with authentication, instead of in the application controller... eggie5 wrote:> Hi, I have this before filter on my application controller for > authentication purposes: > > class ApplicationController < ActionController::Base > before_filter :check_authentication, > :check_authorization, > :except => [:authentication, :login, :logout] > > However, I have some controllers that I don''t even want authenticated. > And as I understand it, expect only takes actions as parameters. How > can I exclude based on controllers? > > I''m starting to think my authentication model isn''t very flexible. > It''s roles and rights recipe from the prag prog rails recipies book.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Maybe I should move my authentication before_filter check to only the > controllers I want to guard with authentication, instead of in the > application controller...Yes... or if you have many controllers that need to be authenticated do this: class AuthenticatedController < ApplicationController before_filter.... end Then for those controllers do: class MyAuthenticatedController < AuthenticatedController. ... end Either way...> > > eggie5 wrote: >> Hi, I have this before filter on my application controller for >> authentication purposes: >> >> class ApplicationController < ActionController::Base >> before_filter :check_authentication, >> :check_authorization, >> :except => [:authentication, :login, :logout] >> >> However, I have some controllers that I don''t even want authenticated. >> And as I understand it, expect only takes actions as parameters. How >> can I exclude based on controllers? >> >> I''m starting to think my authentication model isn''t very flexible. >> It''s roles and rights recipe from the prag prog rails recipies book. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can also use: skip_before_filter in those controllers that don''t need it. -Rob On Sep 14, 2007, at 3:35 PM, Philip Hallstrom wrote:> >> Maybe I should move my authentication before_filter check to only the >> controllers I want to guard with authentication, instead of in the >> application controller... > > Yes... or if you have many controllers that need to be > authenticated do > this: > > class AuthenticatedController < ApplicationController > before_filter.... > end > > Then for those controllers do: > > class MyAuthenticatedController < AuthenticatedController. > ... > end > > Either way... > >> eggie5 wrote: >>> Hi, I have this before filter on my application controller for >>> authentication purposes: >>> >>> class ApplicationController < ActionController::Base >>> before_filter :check_authentication, >>> :check_authorization, >>> :except => [:authentication, :login, :logout] >>> >>> However, I have some controllers that I don''t even want >>> authenticated. >>> And as I understand it, expect only takes actions as parameters. How >>> can I exclude based on controllers? >>> >>> I''m starting to think my authentication model isn''t very flexible. >>> It''s roles and rights recipe from the prag prog rails recipies book.Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---