--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/data/rqlexpr_on_computedrel.py Tue Jul 28 11:15:36 2015 +0200
@@ -0,0 +1,18 @@
+from yams.buildobjs import ComputedRelation, EntityType, RelationDefinition
+from cubicweb.schema import RRQLExpression
+
+class Subject(EntityType):
+ pass
+
+class Object(EntityType):
+ pass
+
+class relation(RelationDefinition):
+ subject = 'Subject'
+ object = 'Object'
+
+class computed(ComputedRelation):
+ rule = 'S relation O'
+ __permissions__ = {'read': (RRQLExpression('S is ET'),)}
+
+
--- a/test/unittest_schema.py Tue Jul 28 09:25:26 2015 +0200
+++ b/test/unittest_schema.py Tue Jul 28 11:15:36 2015 +0200
@@ -417,6 +417,10 @@
self._test('rrqlexpr_on_attr.py',
"can't use RRQLExpression on attribute ToTo.attr[String], use an ERQLExpression")
+ def test_rqlexpr_on_computedrel(self):
+ self._test('rqlexpr_on_computedrel.py',
+ "can't use rql expression for read permission of relation Subject computed Object")
+
class NormalizeExpressionTC(TestCase):