8 messages in com.googlegroups.pylons-discussRe: AuthKit using database for users,...
FromSent OnAttachments
Chris Shenton16 Mar 2007 14:16 
pv16 Mar 2007 15:24 
James Gardner16 Mar 2007 18:14 
James Gardner16 Mar 2007 18:18 
Chris Shenton22 Mar 2007 12:42 
Chris Shenton22 Mar 2007 15:48 
James Gardner26 Mar 2007 10:02 
Cliff Wells26 Mar 2007 16:36 
Subject:Re: AuthKit using database for users, groups, roles?
From:Chris Shenton (chri@public.gmane.org)
Date:03/22/2007 12:42:16 PM
List:com.googlegroups.pylons-discuss

James Gardner <jame@public.gmane.org> writes:

I extracted all the lifeproject code into the AuthDemo code here. http://authkit.org/svn/AuthKit/trunk/examples/pylons/AuthDemo/

Well, the AuthDemo code is a full example of how to store user data in an SQLAlchemy database but other than that I think you will have to do the work yourself. If you have some specific requirements perhaps we can try to build the appropriate code into AuthKit 0.4?

In another reply James Gardner wrote:

I always implement my own database, permissions and valid() function in my code. The users API is simply meant for use in small systems where there isn't any need for a more sophisticated solution.

I've followed the code in AuthDemo and stripped it down quite a bit so that it sorta mirrors the stock user API: username, password; group; roles. I've got it requiring authentication with an:

@authorize(RemoteUser())

so that's going well.

Now I'd like to create other Permissions like RoleIn(['role1','role2']) GroupIn(['group1', 'group2']) to mirror UserIn(). The docs say to subclass Permission, but I'm not sure where to do that so it's available to me. Any suggestions?

Also, I don't understand where -- or if -- I need to define valid(). Currently, I have an "account.py" controller with action "signin" which does the DB lookup and comparison of username/password. I could certainly pull that out into a valid() function but where should it be defined so the rest of AuthKit can use it?

Thanks again for any pointers. Once I get this going a bit more with Group and Role authorization I'll write up a HOWTO or something.