Im looking to do a simple addition to login generator. I want to let users sign up at will, but then have a boolean admin field . some areas will be public, some you must be logged in and some you must be an admin, has anyone done this yet? Not necessarily looking for a gimme of code, just some simple psedo code of what to do. I dont need a whole acl system. just the abilities above. Thanks Sam _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, you wouldn''t need the whole ACL system, instead you could use only users and roles tables and their models? You would work with two roles: admins and unprivileged users. Or once you''ve generated the login system, you can add that field to the users database and forget about roles tables. regards, Vicente. On 9/28/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Im looking to do a simple addition to login generator. > > I want to let users sign up at will, but then have a boolean admin field . > some areas will be public, some you must be logged in and some you must be > an admin, has anyone done this yet? Not necessarily looking for a gimme of > code, just some simple psedo code of what to do. I dont need a whole acl > system. just the abilities above. Thanks > > Sam > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Vicente Reig Rincón de Arellano http://weblogs.javahispano.org/page/vitxo/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I''m doing something similar and I found this to be a great help. I modified it slightly for my use/needs, but it works great. you can restrict access for an entire controller or individual actions based on privileges. I use it on top of login generator. http://wiki.rubyonrails.com/rails/pages/SimpleAccessControlExample hope this helps. Chris On 9/27/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Im looking to do a simple addition to login generator. > > I want to let users sign up at will, but then have a boolean admin field . > some areas will be public, some you must be logged in and some you must be > an admin, has anyone done this yet? Not necessarily looking for a gimme of > code, just some simple psedo code of what to do. I dont need a whole acl > system. just the abilities above. Thanks > > Sam > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
The answer is in this wiki page ;) http://wiki.rubyonrails.com/rails/pages/SaltedHashLoginGenerator 2005/9/28, Chris Hall <christopher.k.hall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> I''m doing something similar and I found this to be a great help. I > modified it slightly for my use/needs, but it works great. you can > restrict access for an entire controller or individual actions based > on privileges. I use it on top of login generator. > > http://wiki.rubyonrails.com/rails/pages/SimpleAccessControlExample > > hope this helps. > > Chris > > On 9/27/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Im looking to do a simple addition to login generator. > > > > I want to let users sign up at will, but then have a boolean admin field . > > some areas will be public, some you must be logged in and some you must be > > an admin, has anyone done this yet? Not necessarily looking for a gimme of > > code, just some simple psedo code of what to do. I dont need a whole acl > > system. just the abilities above. Thanks > > > > Sam > > > > _______________________________________________ > > 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 >