You find some extra informations about AuthKit in "Przewodnik po
Pylons 0.9.7" here[http://tiny.pl/vn2t]

But the way to solve your problem is the most simple User Authkit
class:

---------------------- code ----------------------
from authkit.permissions import *
from pylons import session

class CustomUser(RequestPermission):

    def __init__(self, accept_empty=False):
        self.accept_empty = accept_empty

    def check(self, app, environ, start_response):
        if 'userdata' not in session or 'username' not in session
['userdata']:
            raise NotAuthenticatedError('Not Authenticated')
        elif self.accept_empty==False and not session['userdata']
['username']:
            raise NotAuthorizedError('Not Authorized')

        return app(environ, start_response)
---------------------- code ----------------------

You simple create check() method and check inside some custom things
to make sore all is right. Then you use this class like that:

---------------------- code ----------------------
    @authorize(CustomUser())
    def controller_action(self):
---------------------- code ----------------------

If you want login user you do that in simple action controller where
you send data from form like: login or password or wathever you want.

Greetings from Poland

--
Jan Koprowski
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to