On Dec 6, 2006, at 12:06 PM, Ian Bicking wrote:

>
> Jorge Godoy wrote:
>> "Damjan" <[EMAIL PROTECTED]> writes:
>>
>>> Exactly, but TurboGears needs to make use of it... for example the
>>> decorator:
>>> @identity.require(identity.in_group("admin"))
>>> would use the WSGI environ['REMOTE_USER'] to create a User object  
>>> and
>>> check it's permissions..
>>
>> Hmmm...  From what I've been seeing it is somewhat transparente.   
>> Your WSGI
>> middleware receives two parameters -- env and a method -- and then  
>> process
>> it.  Inside "env" there would be the information needed to  
>> validate the
>> username and password.  The other parameter would be called "on  
>> success" (for
>> this case) and would proceed with your application.  On failure  
>> you could do
>> something else.
>
> A little different.  There's a simple example here:
> http://pythonpaste.org/do-it-yourself-framework.html#wsgi- 
> middleware --
> note in this case it is mixing authorization and authentication.   
> Which
> is bad of course.

Yes, mixing the two is bad. In this case, we could use middleware for  
the authentication and use the decorator notation to specify  
authorization rules for a single method.

I can seriously imagine Identity having a major overhaul for 2.0.

Kevin


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to