author | Philippe Pepiot <philippe.pepiot@logilab.fr> |
Tue, 19 Mar 2019 14:26:51 +0100 | |
changeset 12515 | 2d43c8b30ef0 |
permissions | -rw-r--r-- |
12515
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
1 |
from yams.buildobjs import EntityType, RelationDefinition, String, RichString |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
2 |
from cubicweb.schema import ERQLExpression |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
3 |
|
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
4 |
|
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
5 |
class Basket(EntityType): |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
6 |
"""a basket contains a set of other entities""" |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
7 |
__permissions__ = { |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
8 |
'read': ('managers', ERQLExpression('X owned_by U'),), |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
9 |
'add': ('managers', 'users',), |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
10 |
'delete': ('managers', 'owners',), |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
11 |
'update': ('managers', 'owners',), |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
12 |
} |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
13 |
|
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
14 |
name = String(required=True, indexed=True, internationalizable=True, |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
15 |
maxsize=128) |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
16 |
description = RichString(fulltextindexed=True) |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
17 |
|
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
18 |
|
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
19 |
class in_basket(RelationDefinition): |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
20 |
subject = '*' |
2d43c8b30ef0
[server/test] do not depend on third party cubes
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
21 |
object = 'Basket' |