A collection of opinions, thoughts, tricks and misc. information.
I'm in the process of debugging a CP authentication filter that makes user authentication a whole lot easier. Once it's done, I'll try to find a way to put it up... HOSTING! GIVE ME! Anyway, use is very simple:
from userauth import authorize, UserAuth
return "This is always accessible by anyone."
""" Unless otherwise stated (secret()), no pages under this
module will be viewable by any member outside of the
members and admins groups.
_db = 'sqlite:' + os.path.abspath('filename.db')
_authorized = ['members', 'admins']
_unauthorized = '/login'
return "You're only here if you are a member!"
# It would work to just make this another section all-together, but
# it could be useful...
return "Only members of secret can access this..."
cherrypy.root = Root()
cherrypy.root.members = Members()
Now, you may be wondering, isn't that very similar to multiauth? Yes. There are differences though... For one, and the biggest, is the fact that you use a database connection through sqlobject. That's a big thing for turbogears, but I'm not sure what they've got out there already. My experience with turbogears is my experience with cherrypy and sqlobject, nothing more...
Okay. I'm tired. I'll add to this later...