author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Fri, 14 Aug 2009 18:55:31 +0200 | |
branch | stable |
changeset 2858 | 322272c5d67f |
parent 2476 | 1294a6bdf3bf |
child 3392 | 36bcf206e157 |
child 3877 | 7ca53fc72a0a |
child 4212 | ab6573088b4a |
permissions | -rw-r--r-- |
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
1 |
"""core CubicWeb schema necessary for bootstrapping the actual instance's schema |
0 | 2 |
|
3 |
:organization: Logilab |
|
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1451
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
0 | 5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1451
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
0 | 7 |
""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
8 |
__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
|
9 |
_ = unicode |
0 | 10 |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
11 |
from yams.buildobjs import (EntityType, RelationType, SubjectRelation, |
2459
d088d0ff48a1
move RichString and co to yams, keeping only a small monkeypatch for cw-page-template here
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2438
diff
changeset
|
12 |
ObjectRelation, RichString, String, Boolean, Int) |
d088d0ff48a1
move RichString and co to yams, keeping only a small monkeypatch for cw-page-template here
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2438
diff
changeset
|
13 |
from cubicweb.schema import RQLConstraint |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
14 |
from cubicweb.schemas import META_ETYPE_PERMS, META_RTYPE_PERMS |
0 | 15 |
|
16 |
# not restricted since as "is" is handled as other relations, guests need |
|
17 |
# 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
|
18 |
class CWEType(EntityType): |
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
19 |
"""define an entity type, used to build the instance schema""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
20 |
permissions = META_ETYPE_PERMS |
0 | 21 |
name = String(required=True, indexed=True, internationalizable=True, |
22 |
unique=True, maxsize=64) |
|
1451 | 23 |
description = RichString(internationalizable=True, |
627
36ade1128af7
use RichString wherever possible in the stdlib
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
24 |
description=_('semantic description of this entity type')) |
0 | 25 |
# necessary to filter using RQL |
26 |
final = Boolean(description=_('automatic')) |
|
27 |
||
28 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
29 |
class CWRType(EntityType): |
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
30 |
"""define a relation type, used to build the instance schema""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
31 |
permissions = META_ETYPE_PERMS |
0 | 32 |
name = String(required=True, indexed=True, internationalizable=True, |
33 |
unique=True, maxsize=64) |
|
2129
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
34 |
description = RichString(internationalizable=True, |
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
35 |
description=_('semantic description of this relation type')) |
0 | 36 |
symetric = Boolean(description=_('is this relation equivalent in both direction ?')) |
37 |
inlined = Boolean(description=_('is this relation physically inlined? you should know what you\'re doing if you are changing this!')) |
|
38 |
fulltext_container = String(description=_('if full text content of subject/object entity ' |
|
39 |
'should be added to other side entity (the container).'), |
|
40 |
vocabulary=('', _('subject'), _('object')), |
|
41 |
maxsize=8, default=None) |
|
42 |
final = Boolean(description=_('automatic')) |
|
43 |
||
44 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
45 |
class CWAttribute(EntityType): |
0 | 46 |
"""define a final relation: link a final relation type from a non final |
1451 | 47 |
entity to a final entity type. |
0 | 48 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
49 |
used to build the instance schema |
0 | 50 |
""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
51 |
permissions = META_ETYPE_PERMS |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
52 |
relation_type = SubjectRelation('CWRType', cardinality='1*', |
0 | 53 |
constraints=[RQLConstraint('O final TRUE')], |
54 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
55 |
from_entity = SubjectRelation('CWEType', cardinality='1*', |
0 | 56 |
constraints=[RQLConstraint('O final FALSE')], |
57 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
58 |
to_entity = SubjectRelation('CWEType', cardinality='1*', |
0 | 59 |
constraints=[RQLConstraint('O final TRUE')], |
60 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
61 |
constrained_by = SubjectRelation('CWConstraint', cardinality='*1', composite='subject') |
1451 | 62 |
|
0 | 63 |
cardinality = String(maxsize=2, internationalizable=True, |
1979
daf297034197
remove meaningless cards for attributes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
64 |
vocabulary=[_('?1'), _('11')], |
0 | 65 |
description=_('subject/object cardinality')) |
66 |
ordernum = Int(description=('control subject entity\'s relations order'), default=0) |
|
1451 | 67 |
|
0 | 68 |
indexed = Boolean(description=_('create an index for quick search on this attribute')) |
69 |
fulltextindexed = Boolean(description=_('index this attribute\'s value in the plain text index')) |
|
70 |
internationalizable = Boolean(description=_('is this attribute\'s value translatable')) |
|
71 |
defaultval = String(maxsize=256) |
|
1451 | 72 |
|
2129
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
73 |
description = RichString(internationalizable=True, |
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
74 |
description=_('semantic description of this attribute')) |
1451 | 75 |
|
0 | 76 |
|
1451 | 77 |
CARDINALITY_VOCAB = [_('?*'), _('1*'), _('+*'), _('**'), |
78 |
_('?+'), _('1+'), _('++'), _('*+'), |
|
0 | 79 |
_('?1'), _('11'), _('+1'), _('*1'), |
80 |
_('??'), _('1?'), _('+?'), _('*?')] |
|
81 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
82 |
class CWRelation(EntityType): |
0 | 83 |
"""define a non final relation: link a non final relation type from a non |
1451 | 84 |
final entity to a non final entity type. |
0 | 85 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
86 |
used to build the instance schema |
0 | 87 |
""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
88 |
permissions = META_ETYPE_PERMS |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
89 |
relation_type = SubjectRelation('CWRType', cardinality='1*', |
0 | 90 |
constraints=[RQLConstraint('O final FALSE')], |
91 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
92 |
from_entity = SubjectRelation('CWEType', cardinality='1*', |
0 | 93 |
constraints=[RQLConstraint('O final FALSE')], |
94 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
95 |
to_entity = SubjectRelation('CWEType', cardinality='1*', |
0 | 96 |
constraints=[RQLConstraint('O final FALSE')], |
97 |
composite='object') |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
98 |
constrained_by = SubjectRelation('CWConstraint', cardinality='*1', composite='subject') |
1451 | 99 |
|
0 | 100 |
cardinality = String(maxsize=2, internationalizable=True, |
101 |
vocabulary=CARDINALITY_VOCAB, |
|
102 |
description=_('subject/object cardinality')) |
|
103 |
ordernum = Int(description=_('control subject entity\'s relations order'), |
|
104 |
default=0) |
|
105 |
composite = String(description=_('is the subject/object entity of the relation ' |
|
106 |
'composed of the other ? This implies that when ' |
|
107 |
'the composite is deleted, composants are also ' |
|
108 |
'deleted.'), |
|
109 |
vocabulary=('', _('subject'), _('object')), |
|
110 |
maxsize=8, default=None) |
|
1451 | 111 |
|
2129
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
112 |
description = RichString(internationalizable=True, |
fbfab570a276
use RichString
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2127
diff
changeset
|
113 |
description=_('semantic description of this relation')) |
1451 | 114 |
|
0 | 115 |
|
116 |
# 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
|
117 |
class RQLExpression(EntityType): |
0 | 118 |
"""define a rql expression used to define permissions""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
119 |
permissions = META_ETYPE_PERMS |
0 | 120 |
exprtype = String(required=True, vocabulary=['ERQLExpression', 'RRQLExpression']) |
121 |
mainvars = String(maxsize=8, |
|
122 |
description=_('name of the main variables which should be ' |
|
123 |
'used in the selection if necessary (comma ' |
|
124 |
'separated)')) |
|
1451 | 125 |
expression = String(required=True, |
0 | 126 |
description=_('restriction part of a rql query. ' |
127 |
'For entity rql expression, X and U are ' |
|
128 |
'predefined respectivly to the current object and to ' |
|
129 |
'the request user. For relation rql expression, ' |
|
130 |
'S, O and U are predefined respectivly to the current ' |
|
131 |
'relation\'subject, object and to ' |
|
132 |
'the request user. ')) |
|
133 |
||
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
134 |
read_permission = ObjectRelation(('CWEType', 'CWRType'), cardinality='+?', composite='subject', |
0 | 135 |
description=_('rql expression allowing to read entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
136 |
add_permission = ObjectRelation(('CWEType', 'CWRType'), cardinality='*?', composite='subject', |
0 | 137 |
description=_('rql expression allowing to add entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
138 |
delete_permission = ObjectRelation(('CWEType', 'CWRType'), cardinality='*?', composite='subject', |
0 | 139 |
description=_('rql expression allowing to delete entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
140 |
update_permission = ObjectRelation('CWEType', cardinality='*?', composite='subject', |
0 | 141 |
description=_('rql expression allowing to update entities of this type')) |
1451 | 142 |
|
0 | 143 |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
144 |
class CWConstraint(EntityType): |
0 | 145 |
"""define a schema constraint""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
146 |
permissions = META_ETYPE_PERMS |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
147 |
cstrtype = SubjectRelation('CWConstraintType', cardinality='1*') |
0 | 148 |
value = String(description=_('depends on the constraint type')) |
149 |
||
150 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
151 |
class CWConstraintType(EntityType): |
0 | 152 |
"""define a schema constraint type""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
153 |
permissions = META_ETYPE_PERMS |
0 | 154 |
name = String(required=True, indexed=True, internationalizable=True, |
155 |
unique=True, maxsize=64) |
|
156 |
||
157 |
||
158 |
# 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
|
159 |
class CWGroup(EntityType): |
0 | 160 |
"""define a CubicWeb users group""" |
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 |
permissions = META_ETYPE_PERMS |
0 | 162 |
name = String(required=True, indexed=True, internationalizable=True, |
163 |
unique=True, maxsize=64) |
|
164 |
||
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
165 |
read_permission = ObjectRelation(('CWEType', 'CWRType'), cardinality='+*', |
0 | 166 |
description=_('groups allowed to read entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
167 |
add_permission = ObjectRelation(('CWEType', 'CWRType'), |
0 | 168 |
description=_('groups allowed to add entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
169 |
delete_permission = ObjectRelation(('CWEType', 'CWRType'), |
0 | 170 |
description=_('groups allowed to delete entities/relations of this type')) |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
171 |
update_permission = ObjectRelation('CWEType', |
0 | 172 |
description=_('groups allowed to update entities of this type')) |
1451 | 173 |
|
174 |
||
175 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
176 |
class relation_type(RelationType): |
0 | 177 |
"""link a relation definition to its relation type""" |
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
178 |
permissions = META_RTYPE_PERMS |
0 | 179 |
inlined = True |
1451 | 180 |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
181 |
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
|
182 |
"""link a relation definition to its subject entity type""" |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
183 |
permissions = META_RTYPE_PERMS |
0 | 184 |
inlined = True |
185 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
186 |
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
|
187 |
"""link a relation definition to its object entity type""" |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
188 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
189 |
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
|
190 |
|
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
191 |
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
|
192 |
"""constraints applying on this relation""" |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
193 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
194 |
|
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
195 |
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
|
196 |
"""constraint factory""" |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
197 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
198 |
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
|
199 |
|
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
200 |
class read_permission(RelationType): |
0 | 201 |
"""core relation giving to a group the permission to read an entity or |
202 |
relation type |
|
203 |
""" |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
204 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
205 |
|
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
206 |
class add_permission(RelationType): |
0 | 207 |
"""core relation giving to a group the permission to add an entity or |
208 |
relation type |
|
209 |
""" |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
210 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
211 |
|
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 delete_permission(RelationType): |
0 | 213 |
"""core relation giving to a group the permission to delete an entity or |
214 |
relation type |
|
215 |
""" |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
216 |
permissions = META_RTYPE_PERMS |
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
217 |
|
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
218 |
class update_permission(RelationType): |
0 | 219 |
"""core relation giving to a group the permission to update an entity type |
220 |
""" |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
221 |
permissions = META_RTYPE_PERMS |
0 | 222 |
|
223 |
||
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
224 |
class is_(RelationType): |
0 | 225 |
"""core relation indicating the type of an entity |
226 |
""" |
|
227 |
name = 'is' |
|
228 |
# don't explicitly set composite here, this is handled anyway |
|
229 |
#composite = 'object' |
|
230 |
permissions = { |
|
231 |
'read': ('managers', 'users', 'guests'), |
|
232 |
'add': (), |
|
233 |
'delete': (), |
|
234 |
} |
|
235 |
cardinality = '1*' |
|
2438
576f4d51f826
[cleanup] fix deprecation warnings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2140
diff
changeset
|
236 |
subject = '*' |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
237 |
object = 'CWEType' |
0 | 238 |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
239 |
class is_instance_of(RelationType): |
0 | 240 |
"""core relation indicating the types (including specialized types) |
241 |
of an entity |
|
242 |
""" |
|
243 |
# don't explicitly set composite here, this is handled anyway |
|
244 |
#composite = 'object' |
|
245 |
permissions = { |
|
246 |
'read': ('managers', 'users', 'guests'), |
|
247 |
'add': (), |
|
248 |
'delete': (), |
|
249 |
} |
|
250 |
cardinality = '+*' |
|
2438
576f4d51f826
[cleanup] fix deprecation warnings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2140
diff
changeset
|
251 |
subject = '*' |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
252 |
object = 'CWEType' |
0 | 253 |
|
2140
1cba3393ba01
update schema definition to avoid deprecation warning with new yams api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2129
diff
changeset
|
254 |
class specializes(RelationType): |
0 | 255 |
name = 'specializes' |
256 |
permissions = { |
|
257 |
'read': ('managers', 'users', 'guests'), |
|
258 |
'add': ('managers',), |
|
259 |
'delete': ('managers',), |
|
260 |
} |
|
261 |
cardinality = '?*' |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
262 |
subject = 'CWEType' |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
628
diff
changeset
|
263 |
object = 'CWEType' |