I hope you'll like my authorization model and the fix for JSON in Opera.

This is an example on howto use the authorization:

import turbogears

class Root:
        authRootControl = turbogears.authorization.AuthMD5({'user':
'anonymous'})
        authRoot =
turbogears.authorization.Authentication(authRootControl.checkAuth,
"Root")
        _authorization = authRoot

        authAdminControl = turbogears.authorization.AuthMD5({'admin': 'test'})
        authAdmin =
turbogears.authorization.Authentication(authAdminControl.checkAuth,
"Admin")

        @turbogears.expose()
        def index(self):
                return "You need to be authorized by authRoot"

        @turbogears.expose(auth=authAdmin)
        def admin(self):
                return "authRoot doesn't check for this because
there's authAdmin instead"

--
www.italianpug.org - Italian Python User Group Founder

Attachment: auth-operajson.patch
Description: Binary data

Attachment: authorization.py
Description: Binary data

Reply via email to