Commit c2a61cd7 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[test] Replace symlinks by real copies

This solves a "python setup.py build" issue.
parent df1c74d84668
../data/cubicweb_basket
\ No newline at end of file
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'
../data/cubicweb_card
\ No newline at end of file
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)
../data/cubicweb_comment
\ No newline at end of file
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*'
../data/cubicweb_file
\ No newline at end of file
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')
../data/cubicweb_localperms
\ No newline at end of file
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'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment