querier: Improve error message when ERQLExpression fails on some entity (closes #2267081)
When an RQL variable is indeed "constant" (we know it's eid) ERQL expression are
not inserted but checked prior query execution. If the session have no read
access to the entity an `Unauthorized` exception is raised.
This changeset add a meaningfull message to this exception::
No read acces on "X" with eid 42.
--- a/server/querier.py Mon Mar 26 12:13:40 2012 +0200
+++ b/server/querier.py Wed Mar 21 18:33:12 2012 +0100
@@ -417,7 +417,7 @@
if rqlexpr.check(session, eid):
break
else:
- raise Unauthorized()
+ raise Unauthorized('No read acces on %r with eid %i.' % (var, eid))
restricted_vars.update(localcheck)
localchecks.setdefault(tuple(localcheck.iteritems()), []).append(solution)
# raise Unautorized exception if the user can't access to any solution