test/data/rqlexpr_on_ertype_read.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 17 Mar 2010 09:23:04 +0100
changeset 4922 0c9ff7e496ce
parent 4252 6c4f109c2b03
child 5421 8167de96c523
permissions -rw-r--r--
Added tag cubicweb-version-3.7.0 for changeset 270aba1e6fa2

"""

:organization: Logilab
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""
from yams.buildobjs import EntityType, RelationType, SubjectRelation
from cubicweb.schema import RRQLExpression

class ToTo(EntityType):
    __permissions__ = {
        'read': ('managers',),
        'add': ('managers',),
        'update': ('managers',),
        'delete': ('managers',),
        }
    toto = SubjectRelation('TuTu')

class TuTu(EntityType):
    __permissions__ = {
        'read': ('managers',),
        'add': ('managers',),
        'update': ('managers',),
        'delete': ('managers',),
        }

class toto(RelationType):
    __permissions__ = {
        'read': ('managers', RRQLExpression('S bla Y'), ),
        'add': ('managers',),
        'delete': ('managers',),
        }