cubicweb/test/data_schemareader/schema.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 06 Oct 2016 12:11:23 +0200
changeset 11775 39cf9e55ada8
parent 11057 0b59724cb3f2
child 11911 37726f66ff82
permissions -rw-r--r--
[source] Drop source mapping handling It was only used by the cwxmlparser which has been deleted. This is too complex for litle benefit, we don't want to maintain that in cubicweb.

from yams.buildobjs import EntityType, SubjectRelation
from cubicweb.schemas.base import in_group, RELATION_MANAGERS_PERMISSIONS

# copy __permissions__ to avoid modifying a shared dictionary
in_group.__permissions__ = in_group.__permissions__.copy()
in_group.__permissions__['read'] = ('managers',)


class CWSourceSchemaConfig(EntityType):
    cw_for_source = SubjectRelation(
        'CWSource', inlined=True, cardinality='1*', composite='object',
        __permissions__=RELATION_MANAGERS_PERMISSIONS)

cw_for_source = CWSourceSchemaConfig.get_relation('cw_for_source')
cw_for_source.__permissions__ = {'read': ('managers', 'users'),
                                 'add': ('managers',),
                                 'delete': ('managers',)}