test/data/rqlexpr_on_computedrel.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Dec 2015 16:15:00 +0100
changeset 10951 ef1cfc80d51c
parent 10907 9ae707db5265
permissions -rw-r--r--
action, view and service so managers can start source synchronization from the web ui Closes #5474286

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'),)}