[wip] Inject security context in RQLExpression._check

Related to #4919855

authorChristophe de Vienne <christophe@unlish.com>
changeset37f0846caf23
branchdefault
phasedraft
hiddenyes
parent revision#dd582ac2a037 [wip] Add access to the security_context from subsitute variables
child revision<not specified>
files modified by this revision
schema.py
# HG changeset patch
# User Christophe de Vienne <christophe@unlish.com>
# Date 1424079449 -3600
# Mon Feb 16 10:37:29 2015 +0100
# Node ID 37f0846caf23fa3627399680d2c95ec3e0a66c66
# Parent dd582ac2a0371188b2ce12acbbc3e5d02532a37c
[wip] Inject security context in RQLExpression._check

Related to #4919855

diff --git a/schema.py b/schema.py
@@ -315,10 +315,14 @@
1          between fromeid and toeid
2 
3          _cw may be a request or a server side transaction
4          """
5          creating = kwargs.get('creating')
6 +        # Inject security context into kwargs
7 +        kwargs.update({
8 +            'ctx_' + k: v for k, v in _cw.security_ctx
9 +        })
10          if not creating and self.eid is not None:
11              key = (self.eid, tuple(sorted(kwargs.iteritems())))
12              try:
13                  return _cw.local_perm_cache[key]
14              except KeyError: