I have a resource where there can be private or public items. If an item is public then no login is required to view, but if it''s private then only the owner should be able to see it. I''ve thought that I will just have two controllers. One for when people are logged in and checks for privacy and stuff, and another that just does public access. Is this ok or is there a problem because there will effectively be two URL''s to the one resource? Anyone has a thougt on this? Cheers Daniel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, you should simply use an authentication system like acts_as_authenticated to protect the relevant areas of your site. Good luck, -Conrad On 4/21/07, Daniel N <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a resource where there can be private or public items. > > If an item is public then no login is required to view, but if it''s > private then only the owner should be able to see it. > > I''ve thought that I will just have two controllers. One for when > people are logged in and checks for privacy and stuff, and another > that just does public access. Is this ok or is there a problem > because there will effectively be two URL''s to the one resource? > > Anyone has a thougt on this? > > Cheers > Daniel > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 4/22/07, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, you should simply use an authentication system like > acts_as_authenticated to protect the relevant areas of your site. > > Good luck, > > -ConradHi Conrad, I use the restful_authentication plugin. The items are model instances and so are not constrained by permissions on controllers. Hence the question. The owner of items may have a collection of public and a collection of private items. Another person, or an anonymous user should be able to access these public items. whether logged in or not. I think I''m going to go for two controllers with different layouts. That way I can have public actions on the public layout and logged in actions in the private layout, and the logic is kept reasonably seperate. Thanx for your input though. Cheers --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---