#2205: Provide a simple way to evaluate repoze.what predicates
------------------------------------------------+---------------------------
 Reporter:  chrisz                              |        Owner:  Gustavo 
     Type:  enhancement                         |       Status:  assigned
 Priority:  high                                |    Milestone:  2.0b6   
Component:  TurboGears                          |      Version:  2.0b1   
 Severity:  major                               |   Resolution:          
 Keywords:  repoze.what predicates permissions  |  
------------------------------------------------+---------------------------
Comment (by chrisz):

 I agree with you both. In case of doubt, we should choose the simpler
 solution, so +1 for 3) from me too.

 Btw, this solution will have an additional benefit, namely if you make the
 mistake of writing
 {{{
 @require(in_group('editors') and has_permission('delete'))
 }}}
 instead of
 {{{
 @require(All(in_group('editors'), has_permission('delete')))
 }}}
 then you will get an error because the predicates will be evaluated, but
 there will be no request object at that time, while without the boolean
 evaluation, there would be no error, but it would behave like
 {{{
 @require(has_permission('delete'))
 }}}
 which is probably not what was intended.

 I also suggest making `repoze.what.predicates` available as a standard
 template variable so that standard predicates can be evaluated more easily
 in templates.

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2205#comment:8>
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