# HG changeset patch # User Denis Laxalde # Date 1563979920 -7200 # Node ID 9d72e299309e98147a128f1aedeb678f1529324e # Parent df1c74d846681645b862c5fc1686911b2a147c03 [test] Replace symlinks by real copies This solves a "python setup.py build" issue. diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_basket --- a/cubicweb/server/test/data-migractions/cubicweb_basket Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_basket \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_basket/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_basket/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_basket/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_basket/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_basket/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,21 @@ +from yams.buildobjs import EntityType, RelationDefinition, String, RichString +from cubicweb.schema import ERQLExpression + + +class Basket(EntityType): + """a basket contains a set of other entities""" + __permissions__ = { + 'read': ('managers', ERQLExpression('X owned_by U'),), + 'add': ('managers', 'users',), + 'delete': ('managers', 'owners',), + 'update': ('managers', 'owners',), + } + + name = String(required=True, indexed=True, internationalizable=True, + maxsize=128) + description = RichString(fulltextindexed=True) + + +class in_basket(RelationDefinition): + subject = '*' + object = 'Basket' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_card --- a/cubicweb/server/test/data-migractions/cubicweb_card Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_card \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_card/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_card/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_card/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_card/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_card/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, RichString + + +class Card(EntityType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users'), + 'delete': ('managers', 'owners'), + 'update': ('managers', 'owners',), + } + + title = String(required=True, fulltextindexed=True, maxsize=256) + synopsis = String(fulltextindexed=True, maxsize=512, + description=("an abstract for this card")) + content = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') + wikiid = String(maxsize=64, unique=True) diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_comment --- a/cubicweb/server/test/data-migractions/cubicweb_comment Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_comment \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_comment/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_comment/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_comment/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_comment/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_comment/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,26 @@ +from yams.buildobjs import (EntityType, RelationType, SubjectRelation, + RichString) +from cubicweb.schema import RRQLExpression + + +class Comment(EntityType): + """a comment is a reply about another entity""" + __permissions__ = { + 'read': ('managers', 'users', 'guests',), + 'add': ('managers', 'users',), + 'delete': ('managers', 'owners',), + 'update': ('managers', 'owners',), + } + content = RichString(required=True, fulltextindexed=True) + comments = SubjectRelation('Comment', cardinality='1*', composite='object') + + +class comments(RelationType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users',), + 'delete': ('managers', RRQLExpression('S owned_by U'),), + } + inlined = True + composite = 'object' + cardinality = '1*' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_file --- a/cubicweb/server/test/data-migractions/cubicweb_file Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_file \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_file/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_file/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_file/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_file/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_file/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,27 @@ +from yams.buildobjs import EntityType, String, Bytes, RichString + + +class File(EntityType): + """a downloadable file which may contains binary data""" + title = String(fulltextindexed=True, maxsize=256) + data = Bytes(required=True, description='file to upload') + data_format = String( + required=True, maxsize=128, + description=('MIME type of the file. Should be dynamically set ' + 'at upload time.')) + data_encoding = String( + maxsize=32, + description=('encoding of the file when it applies (e.g. text). ' + 'Should be dynamically set at upload time.')) + data_name = String( + required=True, fulltextindexed=True, + description=('name of the file. Should be dynamically set ' + 'at upload time.')) + data_hash = String( + maxsize=256, # max len of currently available hash alg + prefix is 140 + description=('hash of the file. May be set at upload time.'), + __permissions__={'read': ('managers', 'users', 'guests'), + 'add': (), + 'update': ()}) + description = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_localperms --- a/cubicweb/server/test/data-migractions/cubicweb_localperms Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_localperms \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_localperms/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_localperms/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_localperms/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_localperms/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_localperms/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,42 @@ +from yams.buildobjs import EntityType, RelationType, RelationDefinition, String +from cubicweb.schema import PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS + + +class CWPermission(EntityType): + """entity type that may be used to construct some advanced security + configuration + """ + __permissions__ = PUB_SYSTEM_ENTITY_PERMS + + name = String(required=True, indexed=True, internationalizable=True, + maxsize=100, description=( + 'name or identifier of the permission')) + label = String(required=True, internationalizable=True, maxsize=100, + description=('distinct label to distinguate between other ' + 'permission entity of the same name')) + + +class granted_permission(RelationType): + """explicitly granted permission on an entity""" + __permissions__ = PUB_SYSTEM_REL_PERMS + # XXX cardinality = '*1' + + +class require_permission(RelationType): + __permissions__ = PUB_SYSTEM_REL_PERMS + + +class require_group(RelationDefinition): + """groups to which the permission is granted""" + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWPermission' + object = 'CWGroup' + + +class has_group_permission(RelationDefinition): + """short cut relation for 'U in_group G, P require_group G' for efficiency + reason. This relation is set automatically, you should not set this. + """ + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWUser' + object = 'CWPermission' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_tag --- a/cubicweb/server/test/data-migractions/cubicweb_tag Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_tag \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_tag/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_tag/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_tag/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/cubicweb_tag/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/cubicweb_tag/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, SubjectRelation, RelationType + + +class Tag(EntityType): + """tags are used by users to mark entities. + When you include the Tag entity, all application specific entities + may then be tagged using the "tags" relation. + """ + name = String(required=True, fulltextindexed=True, unique=True, + maxsize=128) + # when using this component, add the Tag tag X relation for each type that + # should be taggeable + tags = SubjectRelation('Tag', description="tagged objects") + + +class tags(RelationType): + """indicates that an entity is classified by a given tag""" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_basket \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_basket/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,21 @@ +from yams.buildobjs import EntityType, RelationDefinition, String, RichString +from cubicweb.schema import ERQLExpression + + +class Basket(EntityType): + """a basket contains a set of other entities""" + __permissions__ = { + 'read': ('managers', ERQLExpression('X owned_by U'),), + 'add': ('managers', 'users',), + 'delete': ('managers', 'owners',), + 'update': ('managers', 'owners',), + } + + name = String(required=True, indexed=True, internationalizable=True, + maxsize=128) + description = RichString(fulltextindexed=True) + + +class in_basket(RelationDefinition): + subject = '*' + object = 'Basket' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_card --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_card Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_card \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_card/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_card/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_card/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_card/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_card/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, RichString + + +class Card(EntityType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users'), + 'delete': ('managers', 'owners'), + 'update': ('managers', 'owners',), + } + + title = String(required=True, fulltextindexed=True, maxsize=256) + synopsis = String(fulltextindexed=True, maxsize=512, + description=("an abstract for this card")) + content = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') + wikiid = String(maxsize=64, unique=True) diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_comment \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_comment/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,26 @@ +from yams.buildobjs import (EntityType, RelationType, SubjectRelation, + RichString) +from cubicweb.schema import RRQLExpression + + +class Comment(EntityType): + """a comment is a reply about another entity""" + __permissions__ = { + 'read': ('managers', 'users', 'guests',), + 'add': ('managers', 'users',), + 'delete': ('managers', 'owners',), + 'update': ('managers', 'owners',), + } + content = RichString(required=True, fulltextindexed=True) + comments = SubjectRelation('Comment', cardinality='1*', composite='object') + + +class comments(RelationType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users',), + 'delete': ('managers', RRQLExpression('S owned_by U'),), + } + inlined = True + composite = 'object' + cardinality = '1*' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_file --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_file Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_file \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_file/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_file/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_file/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_file/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_file/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,27 @@ +from yams.buildobjs import EntityType, String, Bytes, RichString + + +class File(EntityType): + """a downloadable file which may contains binary data""" + title = String(fulltextindexed=True, maxsize=256) + data = Bytes(required=True, description='file to upload') + data_format = String( + required=True, maxsize=128, + description=('MIME type of the file. Should be dynamically set ' + 'at upload time.')) + data_encoding = String( + maxsize=32, + description=('encoding of the file when it applies (e.g. text). ' + 'Should be dynamically set at upload time.')) + data_name = String( + required=True, fulltextindexed=True, + description=('name of the file. Should be dynamically set ' + 'at upload time.')) + data_hash = String( + maxsize=256, # max len of currently available hash alg + prefix is 140 + description=('hash of the file. May be set at upload time.'), + __permissions__={'read': ('managers', 'users', 'guests'), + 'add': (), + 'update': ()}) + description = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_localperms \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_localperms/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,42 @@ +from yams.buildobjs import EntityType, RelationType, RelationDefinition, String +from cubicweb.schema import PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS + + +class CWPermission(EntityType): + """entity type that may be used to construct some advanced security + configuration + """ + __permissions__ = PUB_SYSTEM_ENTITY_PERMS + + name = String(required=True, indexed=True, internationalizable=True, + maxsize=100, description=( + 'name or identifier of the permission')) + label = String(required=True, internationalizable=True, maxsize=100, + description=('distinct label to distinguate between other ' + 'permission entity of the same name')) + + +class granted_permission(RelationType): + """explicitly granted permission on an entity""" + __permissions__ = PUB_SYSTEM_REL_PERMS + # XXX cardinality = '*1' + + +class require_permission(RelationType): + __permissions__ = PUB_SYSTEM_REL_PERMS + + +class require_group(RelationDefinition): + """groups to which the permission is granted""" + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWPermission' + object = 'CWGroup' + + +class has_group_permission(RelationDefinition): + """short cut relation for 'U in_group G, P require_group G' for efficiency + reason. This relation is set automatically, you should not set this. + """ + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWUser' + object = 'CWPermission' diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag --- a/cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../data/cubicweb_tag \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, SubjectRelation, RelationType + + +class Tag(EntityType): + """tags are used by users to mark entities. + When you include the Tag entity, all application specific entities + may then be tagged using the "tags" relation. + """ + name = String(required=True, fulltextindexed=True, unique=True, + maxsize=128) + # when using this component, add the Tag tag X relation for each type that + # should be taggeable + tags = SubjectRelation('Tag', description="tagged objects") + + +class tags(RelationType): + """indicates that an entity is classified by a given tag""" diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_card --- a/cubicweb/sobjects/test/data/cubicweb_card Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../../../cubicweb/test/data/cubicweb_card \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_card/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_card/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_card/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_card/entities.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_card/entities.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,15 @@ +from cubicweb.entities import AnyEntity, fetch_config + + +class Card(AnyEntity): + __regid__ = 'Card' + rest_attr = 'wikiid' + + fetch_attrs, cw_fetch_order = fetch_config(['title']) + + def rest_path(self): + if self.wikiid: + return '%s/%s' % (str(self.e_schema).lower(), + self._cw.url_quote(self.wikiid, safe='/')) + else: + return super(Card, self).rest_path() diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_card/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_card/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, RichString + + +class Card(EntityType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users'), + 'delete': ('managers', 'owners'), + 'update': ('managers', 'owners',), + } + + title = String(required=True, fulltextindexed=True, maxsize=256) + synopsis = String(fulltextindexed=True, maxsize=512, + description=("an abstract for this card")) + content = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') + wikiid = String(maxsize=64, unique=True) diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_comment --- a/cubicweb/sobjects/test/data/cubicweb_comment Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../../../cubicweb/test/data/cubicweb_comment \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_comment/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_comment/__init__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr +# +# This file is part of CubicWeb. +# +# CubicWeb is free software: you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 2.1 of the License, or (at your option) +# any later version. +# +# CubicWeb is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with CubicWeb. If not, see . diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_comment/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_comment/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,25 @@ +# pylint: disable=W0622 +# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr +# +# This file is part of CubicWeb. +# +# CubicWeb is free software: you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 2.1 of the License, or (at your option) +# any later version. +# +# CubicWeb is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with CubicWeb. If not, see . +"""cubicweb-comment packaging information""" + +distname = "cubicweb-comment" +modname = distname.split('-', 1)[1] + +numversion = (1, 4, 3) +version = '.'.join(str(num) for num in numversion) diff -r df1c74d84668 -r 9d72e299309e cubicweb/sobjects/test/data/cubicweb_comment/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/sobjects/test/data/cubicweb_comment/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,26 @@ +from yams.buildobjs import (EntityType, RelationType, SubjectRelation, + RichString) +from cubicweb.schema import RRQLExpression + + +class Comment(EntityType): + """a comment is a reply about another entity""" + __permissions__ = { + 'read': ('managers', 'users', 'guests',), + 'add': ('managers', 'users',), + 'delete': ('managers', 'owners',), + 'update': ('managers', 'owners',), + } + content = RichString(required=True, fulltextindexed=True) + comments = SubjectRelation('Comment', cardinality='1*', composite='object') + + +class comments(RelationType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users',), + 'delete': ('managers', RRQLExpression('S owned_by U'),), + } + inlined = True + composite = 'object' + cardinality = '1*' diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_card --- a/cubicweb/test/data-rewrite/cubicweb_card Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_card \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_card/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_card/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/test/data-rewrite/cubicweb_card/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_card/entities.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/test/data-rewrite/cubicweb_card/entities.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,15 @@ +from cubicweb.entities import AnyEntity, fetch_config + + +class Card(AnyEntity): + __regid__ = 'Card' + rest_attr = 'wikiid' + + fetch_attrs, cw_fetch_order = fetch_config(['title']) + + def rest_path(self): + if self.wikiid: + return '%s/%s' % (str(self.e_schema).lower(), + self._cw.url_quote(self.wikiid, safe='/')) + else: + return super(Card, self).rest_path() diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_card/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/test/data-rewrite/cubicweb_card/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,17 @@ +from yams.buildobjs import EntityType, String, RichString + + +class Card(EntityType): + __permissions__ = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users'), + 'delete': ('managers', 'owners'), + 'update': ('managers', 'owners',), + } + + title = String(required=True, fulltextindexed=True, maxsize=256) + synopsis = String(fulltextindexed=True, maxsize=512, + description=("an abstract for this card")) + content = RichString(fulltextindexed=True, internationalizable=True, + default_format='text/rest') + wikiid = String(maxsize=64, unique=True) diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_localperms --- a/cubicweb/test/data-rewrite/cubicweb_localperms Wed Jul 24 16:03:01 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../data/cubicweb_localperms \ No newline at end of file diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_localperms/__init__.py diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_localperms/__pkginfo__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/test/data-rewrite/cubicweb_localperms/__pkginfo__.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,2 @@ +numversion = (1, 2, 3) +version = "1.2.3" diff -r df1c74d84668 -r 9d72e299309e cubicweb/test/data-rewrite/cubicweb_localperms/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cubicweb/test/data-rewrite/cubicweb_localperms/schema.py Wed Jul 24 16:52:00 2019 +0200 @@ -0,0 +1,42 @@ +from yams.buildobjs import EntityType, RelationType, RelationDefinition, String +from cubicweb.schema import PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS + + +class CWPermission(EntityType): + """entity type that may be used to construct some advanced security + configuration + """ + __permissions__ = PUB_SYSTEM_ENTITY_PERMS + + name = String(required=True, indexed=True, internationalizable=True, + maxsize=100, description=( + 'name or identifier of the permission')) + label = String(required=True, internationalizable=True, maxsize=100, + description=('distinct label to distinguate between other ' + 'permission entity of the same name')) + + +class granted_permission(RelationType): + """explicitly granted permission on an entity""" + __permissions__ = PUB_SYSTEM_REL_PERMS + # XXX cardinality = '*1' + + +class require_permission(RelationType): + __permissions__ = PUB_SYSTEM_REL_PERMS + + +class require_group(RelationDefinition): + """groups to which the permission is granted""" + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWPermission' + object = 'CWGroup' + + +class has_group_permission(RelationDefinition): + """short cut relation for 'U in_group G, P require_group G' for efficiency + reason. This relation is set automatically, you should not set this. + """ + __permissions__ = PUB_SYSTEM_REL_PERMS + subject = 'CWUser' + object = 'CWPermission'