Ticket #1343: none_predicate2.diff
| File none_predicate2.diff, 0.8 kB (added by faide, 1 year ago) |
|---|
-
turbogears/identity/conditions.py
old new 64 64 self.append_error_message( errors ) 65 65 return False 66 66 67 class NotAny(CompoundPredicate): 68 ''' 69 A compound predicate that evaluates to true only if no sub-predicates 70 evaluate to true for the given input. 71 ''' 72 error_message= "A predicate was able to grant access" 73 74 def eval_with_object( self, obj, errors=None ): 75 ''' 76 Return true if no sub-predicates evaluate to true. 77 ''' 78 for p in self.predicates: 79 if p.eval_with_object(obj, errors): 80 self.append_error_message(errors) 81 return False 82 83 return True 67 84 68 85 class IdentityPredicateHelper(object): 69 86 '''