[Zope-dev] Re: Post-authentication hook

2003-06-10 Thread Dieter Maurer
Chris Withers wrote at 2003-6-10 13:24 +0100:
  Dieter Maurer wrote:
  When we had a post-authentication hook (a hook called by
  ZPublisher after authentication has been done),
  then we could check in this hook that the user has
  the right to enter the version.
  
  When did we have one? Where did it go?

English is difficult and it is not my mother tongue.

I meant:

   If we had (would have) a post-authentication hook ...

We had discussed the post-authentication hook in connection
with role based skin selection but we never had it implemented.

  Such a hook would be extremely helpful for other applications,
  too.
  
  Yeah, a specific example that springs to mind is the selection of a CMF skin 
  based on a user's role...

Indeed. That where the post-authentication hook idea came into existence...


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Post-authentication hook

2003-06-10 Thread Evan Simpson
Dieter Maurer wrote:
We had discussed the post-authentication hook in connection
with role based skin selection but we never had it implemented.
I have, and it even fits here in the margin.  Shall I pop it into the 
Collector?

242a243
 self._post_traverse = post_traverse = []
363a365
 del self._post_traverse
434a437,439
 if post_traverse:
 exec_callables(post_traverse)

444a450,453
 def post_traverse(self, f, args):
 Set a callable object and argument tuple
to be combined if traversal succeeds
 self._post_traverse.append((f, tuple(args)))
445a455,470
 def exec_callables(callables):
 for (f, args) in callables:
 try:
 f(*args)
 except (ArithmeticError, AttributeError, FloatingPointError,
 IOError, ImportError, IndexError, KeyError,
 OSError, OverflowError, TypeError, ValueError,
 ZeroDivisionError):
 # Only catch exceptions likely to be logic errors.
 # We shouldn't catch Redirects, Unauthorizeds, etc. since
 # the programmer may want to raise them deliberately.
 from zLOG import LOG, ERROR
 import sys
 LOG('PostTraverse', ERROR,
 'Error while invoking hook: %s' % `f`,
 error=sys.exc_info())
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Post-authentication hook

2003-06-10 Thread robert
Please do,
I need it for some some extra authentication against a mysql db.
Robert

Am Dienstag, 10. Juni 2003 20:41 schrieb Evan Simpson:
 Dieter Maurer wrote:
  We had discussed the post-authentication hook in connection
  with role based skin selection but we never had it implemented.

 I have, and it even fits here in the margin.  Shall I pop it into the
 Collector?

 242a243

   self._post_traverse = post_traverse = []

 363a365

   del self._post_traverse

 434a437,439

   if post_traverse:
   exec_callables(post_traverse)

 444a450,453

   def post_traverse(self, f, args):
   Set a callable object and argument tuple
  to be combined if traversal succeeds
   self._post_traverse.append((f, tuple(args)))

 445a455,470

   def exec_callables(callables):
   for (f, args) in callables:
   try:
   f(*args)
   except (ArithmeticError, AttributeError, FloatingPointError,
   IOError, ImportError, IndexError, KeyError,
   OSError, OverflowError, TypeError, ValueError,
   ZeroDivisionError):
   # Only catch exceptions likely to be logic errors.
   # We shouldn't catch Redirects, Unauthorizeds, etc. since
   # the programmer may want to raise them deliberately.
   from zLOG import LOG, ERROR
   import sys
   LOG('PostTraverse', ERROR,
   'Error while invoking hook: %s' % `f`,
   error=sys.exc_info())

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )

-- 
mit freundlichen GrĂ¼ssen

Robert Rottermann
www.redCOR.ch


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Post-authentication hook

2003-06-10 Thread Evan Simpson
robert wrote:
Please do
Okeydoke: it's Issue #935.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )