#2112: [Patch] Allow overriding @require error handling
-------------------------+--------------------------------------------------
 Reporter:  vinces1979   |        Owner:  Gustavo 
     Type:  enhancement  |       Status:  assigned
 Priority:  normal       |    Milestone:  2.0b2   
Component:  TurboGears   |      Version:  trunk   
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by vinces1979):

 Good point I forgot about the allow_only, I am using this in a pyamf
 application so my Controller  handles the allow_only already.

 I created a patch for adding _failed_authorization to the _check_security

 example Usuage:

 {{{
 from pylons.controllers.util import abort

 class Secc(BaseController):
     """Sample controller-wide authorization"""

     # The predicate that must be met for all the actions in this
 controller:
     allow_only = has_permission('manage',
                                 msg=_('Only for people with the "manage"
 permission'))

     def _failed_authorization(self, *args, **kws):
         log.debug("Custom Error Called %s %s" % (args, kws))
         abort("500", "Not Found")


 }}}

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2112#comment:4>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to