schemas/bootstrap.py
author Lea Capgen <lea.capgen@logilab.fr>
Thu, 28 Aug 2014 18:29:14 +0200
changeset 9956 19a683a0047c
parent 9395 96dba2efd16d
child 9965 a8769b752299
permissions -rw-r--r--
[CWEP002] properly handle serialization of computed relations We now: * have CWComputedRelation in the bootstrap schema to store computed relations * properly serialize/deserialize it * test first if the database has been migrated and contains the related table Related to #3546717 [jcr: adjust unittest_querier to pass with the added entity type]
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8945
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents: 6815
diff changeset
     1
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5179
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2459
diff changeset
    18
"""core CubicWeb schema necessary for bootstrapping the actual instance's schema
5782
8ff48d1a319f [rql2sql] when using HAVING to by-pass rql limitation (not to filter on result of an aggregat function), we should emit SQL that doesn't use HAVING to avoid potential backend error because variables are not grouped. Closes #1061603.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5424
diff changeset
    19
"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
    21
__docformat__ = "restructuredtext en"
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
    22
_ = unicode
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    23
8945
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents: 6815
diff changeset
    24
from yams.buildobjs import (EntityType, RelationType, RelationDefinition, Bytes,
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
    25
                            SubjectRelation, RichString, String, Boolean, Int)
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    26
from cubicweb.schema import (
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    27
    RQLConstraint,
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    28
    PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    29
    )
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
# not restricted since as "is" is handled as other relations, guests need
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
# access to this
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
    33
class CWEType(EntityType):
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2459
diff changeset
    34
    """define an entity type, used to build the instance schema"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    35
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
    name = String(required=True, indexed=True, internationalizable=True,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
                  unique=True, maxsize=64)
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
    38
    description = RichString(internationalizable=True,
627
36ade1128af7 use RichString wherever possible in the stdlib
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    39
                             description=_('semantic description of this entity type'))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    40
    # necessary to filter using RQL
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
    final = Boolean(description=_('automatic'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    42
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
    44
class CWRType(EntityType):
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2459
diff changeset
    45
    """define a relation type, used to build the instance schema"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    46
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    47
    name = String(required=True, indexed=True, internationalizable=True,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
                  unique=True, maxsize=64)
2129
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
    49
    description = RichString(internationalizable=True,
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
    50
                             description=_('semantic description of this relation type'))
4467
0e73d299730a fix long-waiting symetric typo: should be spelled symmetric. Add auto database migration on schema deserialization
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4319
diff changeset
    51
    symmetric = Boolean(description=_('is this relation equivalent in both direction ?'))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
    inlined = Boolean(description=_('is this relation physically inlined? you should know what you\'re doing if you are changing this!'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    53
    fulltext_container = String(description=_('if full text content of subject/object entity '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    54
                                              'should be added to other side entity (the container).'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    55
                                vocabulary=('', _('subject'), _('object')),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    56
                                maxsize=8, default=None)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    57
    final = Boolean(description=_('automatic'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    58
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    59
9956
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    60
class CWComputedRType(EntityType):
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    61
    """define a virtual relation type, used to build the instance schema"""
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    62
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    63
    name = String(required=True, indexed=True, internationalizable=True,
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    64
                  unique=True, maxsize=64)
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    65
    description = RichString(internationalizable=True,
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    66
                             description=_('semantic description of this relation type'))
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    67
    rule = String(required=True)
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    68
19a683a0047c [CWEP002] properly handle serialization of computed relations
Lea Capgen <lea.capgen@logilab.fr>
parents: 9395
diff changeset
    69
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
    70
class CWAttribute(EntityType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    71
    """define a final relation: link a final relation type from a non final
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
    72
    entity to a final entity type.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    73
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2459
diff changeset
    74
    used to build the instance schema
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    75
    """
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
    76
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
    77
    relation_type = SubjectRelation('CWRType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    78
                                    constraints=[RQLConstraint('O final TRUE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    79
                                    composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
    80
    from_entity = SubjectRelation('CWEType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
                                  constraints=[RQLConstraint('O final FALSE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    82
                                  composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
    83
    to_entity = SubjectRelation('CWEType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    84
                                constraints=[RQLConstraint('O final TRUE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
                                composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
    86
    constrained_by = SubjectRelation('CWConstraint', cardinality='*1', composite='subject')
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
    87
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
    cardinality = String(maxsize=2, internationalizable=True,
1979
daf297034197 remove meaningless cards for attributes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    89
                         vocabulary=[_('?1'), _('11')],
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
                         description=_('subject/object cardinality'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
    ordernum = Int(description=('control subject entity\'s relations order'), default=0)
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
    92
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93
    indexed = Boolean(description=_('create an index for quick search on this attribute'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
    fulltextindexed = Boolean(description=_('index this attribute\'s value in the plain text index'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
    internationalizable = Boolean(description=_('is this attribute\'s value translatable'))
9299
c5eed908117d [schema] store default attribute values in a Bytes field, allowing python objects as default values
Aurélien Campeas <aurelien.campeas@logilab.fr>
parents: 8945
diff changeset
    96
    defaultval = Bytes(description=_('default value as gziped pickled python object'))
8945
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents: 6815
diff changeset
    97
    extra_props = Bytes(description=_('additional type specific properties'))
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
    98
2129
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
    99
    description = RichString(internationalizable=True,
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
   100
                             description=_('semantic description of this attribute'))
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   101
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   102
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   103
CARDINALITY_VOCAB = [_('?*'), _('1*'), _('+*'), _('**'),
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   104
                     _('?+'), _('1+'), _('++'), _('*+'),
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
                     _('?1'), _('11'), _('+1'), _('*1'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   106
                     _('??'), _('1?'), _('+?'), _('*?')]
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   107
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   108
class CWRelation(EntityType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
    """define a non final relation: link a non final relation type from a non
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   110
    final entity to a non final entity type.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   111
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2459
diff changeset
   112
    used to build the instance schema
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   113
    """
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   114
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   115
    relation_type = SubjectRelation('CWRType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   116
                                    constraints=[RQLConstraint('O final FALSE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   117
                                    composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   118
    from_entity = SubjectRelation('CWEType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   119
                                  constraints=[RQLConstraint('O final FALSE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   120
                                  composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   121
    to_entity = SubjectRelation('CWEType', cardinality='1*',
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   122
                                constraints=[RQLConstraint('O final FALSE')],
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   123
                                composite='object')
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   124
    constrained_by = SubjectRelation('CWConstraint', cardinality='*1', composite='subject')
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   125
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   126
    cardinality = String(maxsize=2, internationalizable=True,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
                         vocabulary=CARDINALITY_VOCAB,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   128
                         description=_('subject/object cardinality'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   129
    ordernum = Int(description=_('control subject entity\'s relations order'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   130
                   default=0)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   131
    composite = String(description=_('is the subject/object entity of the relation '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   132
                                     'composed of the other ? This implies that when '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   133
                                     'the composite is deleted, composants are also '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   134
                                     'deleted.'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   135
                       vocabulary=('', _('subject'), _('object')),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   136
                       maxsize=8, default=None)
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   137
2129
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
   138
    description = RichString(internationalizable=True,
fbfab570a276 use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2127
diff changeset
   139
                             description=_('semantic description of this relation'))
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   140
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   141
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   142
# not restricted since it has to be read when checking allowed transitions
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   143
class RQLExpression(EntityType):
4535
71c86a315a9a update translatable docstring
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4467
diff changeset
   144
    """define a rql expression used to define permissions"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   145
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   146
    exprtype = String(required=True, vocabulary=['ERQLExpression', 'RRQLExpression'])
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   147
    mainvars = String(maxsize=8,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   148
                      description=_('name of the main variables which should be '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   149
                                    'used in the selection if necessary (comma '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   150
                                    'separated)'))
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   151
    expression = String(required=True,
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   152
                        description=_('restriction part of a rql query. '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   153
                                      'For entity rql expression, X and U are '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   154
                                      'predefined respectivly to the current object and to '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   155
                                      'the request user. For relation rql expression, '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   156
                                      'S, O and U are predefined respectivly to the current '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   157
                                      'relation\'subject, object and to '
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   158
                                      'the request user. '))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   159
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   160
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   161
class CWConstraint(EntityType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   162
    """define a schema constraint"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   163
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   164
    cstrtype = SubjectRelation('CWConstraintType', cardinality='1*')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   165
    value = String(description=_('depends on the constraint type'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   166
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   167
6208
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   168
class CWUniqueTogetherConstraint(EntityType):
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   169
    """defines a sql-level multicolumn unique index"""
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   170
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
9375
8e88576787c3 [schema] fix unique together index handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 9299
diff changeset
   171
    name = String(required=True, unique=True, maxsize=64)
6208
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   172
    constraint_of = SubjectRelation('CWEType', cardinality='1*', composite='object',
6209
e3e5870807e9 fix tests
syt
parents: 6208
diff changeset
   173
                                    inlined=True)
6815
a84190d4e78c [schema] fix pb with ambiguous relation used within UniqueTogetherConstraint by having CWUniqueTogetherConstraint.relation targeting CWRType instead of CWAttribute/CWRelation. This fixes 3.10.7 migration.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6209
diff changeset
   174
    relations = SubjectRelation('CWRType', cardinality='+*',
a84190d4e78c [schema] fix pb with ambiguous relation used within UniqueTogetherConstraint by having CWUniqueTogetherConstraint.relation targeting CWRType instead of CWAttribute/CWRelation. This fixes 3.10.7 migration.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6209
diff changeset
   175
                                constraints=[RQLConstraint(
a84190d4e78c [schema] fix pb with ambiguous relation used within UniqueTogetherConstraint by having CWUniqueTogetherConstraint.relation targeting CWRType instead of CWAttribute/CWRelation. This fixes 3.10.7 migration.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6209
diff changeset
   176
           'S constraint_of ET, RDEF relation_type O, RDEF from_entity ET, '
a84190d4e78c [schema] fix pb with ambiguous relation used within UniqueTogetherConstraint by having CWUniqueTogetherConstraint.relation targeting CWRType instead of CWAttribute/CWRelation. This fixes 3.10.7 migration.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6209
diff changeset
   177
           'O final TRUE OR (O final FALSE AND O inlined TRUE)')])
6208
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   178
07b176640a8c unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 5782
diff changeset
   179
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   180
class CWConstraintType(EntityType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   181
    """define a schema constraint type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   182
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   183
    name = String(required=True, indexed=True, internationalizable=True,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   184
                  unique=True, maxsize=64)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   185
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   186
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   187
# not restricted since it has to be read when checking allowed transitions
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   188
class CWGroup(EntityType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   189
    """define a CubicWeb users group"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   190
    __permissions__ = PUB_SYSTEM_ENTITY_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   191
    name = String(required=True, indexed=True, internationalizable=True,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   192
                  unique=True, maxsize=64)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   193
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   194
3392
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   195
class CWProperty(EntityType):
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   196
    """used for cubicweb configuration. Once a property has been created you
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   197
    can't change the key.
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   198
    """
4003
b9436fe77c9e fix bad merge
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3890
diff changeset
   199
    __permissions__ = {
3392
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   200
        'read':   ('managers', 'users', 'guests'),
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   201
        'add':    ('managers', 'users',),
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   202
        'update': ('managers', 'owners',),
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   203
        'delete': ('managers', 'owners',),
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   204
        }
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   205
    # key is a reserved word for mysql
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   206
    pkey = String(required=True, internationalizable=True, maxsize=256,
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   207
                  description=_('defines what\'s the property is applied for. '
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   208
                                'You must select this first to be able to set '
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   209
                                'value'))
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   210
    value = String(internationalizable=True, maxsize=256)
36bcf206e157 [schema] CWProperty is required at bootstrap time
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 2476
diff changeset
   211
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   212
class relation_type(RelationType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   213
    """link a relation definition to its relation type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   214
    __permissions__ = PUB_SYSTEM_REL_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   215
    inlined = True
1451
982e8616d9a2 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
   216
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   217
class from_entity(RelationType):
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   218
    """link a relation definition to its subject entity type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   219
    __permissions__ = PUB_SYSTEM_REL_PERMS
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   220
    inlined = True
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   221
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   222
class to_entity(RelationType):
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   223
    """link a relation definition to its object entity type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   224
    __permissions__ = PUB_SYSTEM_REL_PERMS
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   225
    inlined = True
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   226
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   227
class constrained_by(RelationType):
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   228
    """constraints applying on this relation"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   229
    __permissions__ = PUB_SYSTEM_REL_PERMS
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   230
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   231
class cstrtype(RelationType):
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   232
    """constraint factory"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   233
    __permissions__ = PUB_SYSTEM_REL_PERMS
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   234
    inlined = True
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   235
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   236
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   237
class read_permission_cwgroup(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   238
    """groups allowed to read entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   239
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   240
    name = 'read_permission'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   241
    subject = ('CWEType', 'CWAttribute', 'CWRelation')
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   242
    object = 'CWGroup'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   243
    cardinality = '**'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   244
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   245
class add_permission_cwgroup(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   246
    """groups allowed to add entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   247
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   248
    name = 'add_permission'
9395
96dba2efd16d [hooks/security] provide attribute "add" permission
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 9375
diff changeset
   249
    subject = ('CWEType', 'CWRelation', 'CWAttribute')
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   250
    object = 'CWGroup'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   251
    cardinality = '**'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   252
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   253
class delete_permission_cwgroup(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   254
    """groups allowed to delete entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   255
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   256
    name = 'delete_permission'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   257
    subject = ('CWEType', 'CWRelation')
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   258
    object = 'CWGroup'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   259
    cardinality = '**'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   260
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   261
class update_permission_cwgroup(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   262
    """groups allowed to update entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   263
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   264
    name = 'update_permission'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   265
    subject = ('CWEType', 'CWAttribute')
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   266
    object = 'CWGroup'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   267
    cardinality = '**'
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   268
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   269
class read_permission_rqlexpr(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   270
    """rql expression allowing to read entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   271
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   272
    name = 'read_permission'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   273
    subject = ('CWEType', 'CWAttribute', 'CWRelation')
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   274
    object = 'RQLExpression'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   275
    cardinality = '*?'
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   276
    composite = 'subject'
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   277
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   278
class add_permission_rqlexpr(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   279
    """rql expression allowing to add entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   280
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   281
    name = 'add_permission'
9395
96dba2efd16d [hooks/security] provide attribute "add" permission
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 9375
diff changeset
   282
    subject = ('CWEType', 'CWRelation', 'CWAttribute')
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   283
    object = 'RQLExpression'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   284
    cardinality = '*?'
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   285
    composite = 'subject'
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   286
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   287
class delete_permission_rqlexpr(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   288
    """rql expression allowing to delete entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   289
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   290
    name = 'delete_permission'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   291
    subject = ('CWEType', 'CWRelation')
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   292
    object = 'RQLExpression'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   293
    cardinality = '*?'
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   294
    composite = 'subject'
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   295
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   296
class update_permission_rqlexpr(RelationDefinition):
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   297
    """rql expression allowing to update entities/relations of this type"""
4754
6bf17f810975 [schema] new constants for permissions definitions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4588
diff changeset
   298
    __permissions__ = PUB_SYSTEM_REL_PERMS
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   299
    name = 'update_permission'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   300
    subject = ('CWEType', 'CWAttribute')
4588
36b700c00d38 fix *_permissions schema: using the same cardinality/composite properties for cwgroup/rqlexpr leads to important pbs...
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4570
diff changeset
   301
    object = 'RQLExpression'
4570
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   302
    cardinality = '*?'
ede247bbbf62 follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4535
diff changeset
   303
    composite = 'subject'
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   304
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   305
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   306
class is_(RelationType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   307
    """core relation indicating the type of an entity
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   308
    """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   309
    name = 'is'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   310
    # don't explicitly set composite here, this is handled anyway
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   311
    #composite = 'object'
3877
7ca53fc72a0a reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2476
diff changeset
   312
    __permissions__ = {
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   313
        'read':   ('managers', 'users', 'guests'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   314
        'add':    (),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   315
        'delete': (),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   316
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   317
    cardinality = '1*'
2438
576f4d51f826 [cleanup] fix deprecation warnings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2140
diff changeset
   318
    subject = '*'
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   319
    object = 'CWEType'
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   320
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   321
class is_instance_of(RelationType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   322
    """core relation indicating the types (including specialized types)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   323
    of an entity
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   324
    """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   325
    # don't explicitly set composite here, this is handled anyway
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   326
    #composite = 'object'
3877
7ca53fc72a0a reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2476
diff changeset
   327
    __permissions__ = {
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   328
        'read':   ('managers', 'users', 'guests'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   329
        'add':    (),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   330
        'delete': (),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   331
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   332
    cardinality = '+*'
2438
576f4d51f826 [cleanup] fix deprecation warnings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2140
diff changeset
   333
    subject = '*'
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   334
    object = 'CWEType'
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   335
2140
1cba3393ba01 update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2129
diff changeset
   336
class specializes(RelationType):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   337
    name = 'specializes'
3877
7ca53fc72a0a reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2476
diff changeset
   338
    __permissions__ = {
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   339
        'read':   ('managers', 'users', 'guests'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   340
        'add':    ('managers',),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   341
        'delete': ('managers',),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   342
        }
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   343
    cardinality = '?*'
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   344
    subject = 'CWEType'
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 628
diff changeset
   345
    object = 'CWEType'
4755
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   346
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   347
def post_build_callback(schema):
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   348
    """set attributes permissions for schema/workflow entities"""
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   349
    from cubicweb.schema import SCHEMA_TYPES, WORKFLOW_TYPES, META_RTYPES
5179
f08943f22334 [schema] #847739: test and fix bad permission on TrInfo.comment
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4755
diff changeset
   350
    wftypes = WORKFLOW_TYPES - set(('TrInfo',))
4755
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   351
    for eschema in schema.entities():
5179
f08943f22334 [schema] #847739: test and fix bad permission on TrInfo.comment
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4755
diff changeset
   352
        if eschema in SCHEMA_TYPES or eschema in wftypes:
4755
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   353
            for rschema in eschema.subject_relations():
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   354
                if rschema.final and not rschema in META_RTYPES:
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   355
                    rdef = eschema.rdef(rschema)
13a5d3a7410e [schema] tweaks meta-relations and schema/workflow entities attributes permissions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4754
diff changeset
   356
                    rdef.permissions = PUB_SYSTEM_ATTR_PERMS