# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1233060709 -3600 # Node ID b32a5772ff0682e272592701d689bf4cba484fa1 # Parent 99712f0d5472ab3699a937d4f4055989913a2daf should clear local perm cache if first attempt failed diff -r 99712f0d5472 -r b32a5772ff06 common/entity.py --- a/common/entity.py Fri Jan 23 15:51:24 2009 +0100 +++ b/common/entity.py Tue Jan 27 13:51:49 2009 +0100 @@ -391,6 +391,10 @@ res['source'] = self.req.source_defs()[res['source']] return res + def clear_local_perm_cache(self, action): + for rqlexpr in self.e_schema.get_rqlexprs(action): + self.req.local_perm_cache.pop((rqlexpr.eid, (('x', self.eid),)), None) + def check_perm(self, action): self.e_schema.check_perm(self.req, action, self.eid) diff -r 99712f0d5472 -r b32a5772ff06 server/securityhooks.py --- a/server/securityhooks.py Fri Jan 23 15:51:24 2009 +0100 +++ b/server/securityhooks.py Tue Jan 27 13:51:49 2009 +0100 @@ -54,6 +54,7 @@ entity.check_perm('update') check_entity_attributes(session, entity) except Unauthorized: + entity.clear_local_perm_cache('update') CheckEntityPermissionOp(session, entity=entity, action='update') def before_del_entity(session, eid):