diff -r 1bb43e31032d -r a14b6562082b schemas/base.py --- a/schemas/base.py Tue Feb 14 15:14:22 2012 +0100 +++ b/schemas/base.py Tue Jul 10 15:07:23 2012 +0200 @@ -181,31 +181,6 @@ cardinality = '?*' -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')) - require_group = SubjectRelation('CWGroup', - description=_('groups to which the permission is granted')) - -# explicitly add X require_permission CWPermission for each entity that should have -# configurable security -class require_permission(RelationType): - """link a permission to the entity. This permission should be used in the - security definition of the entity's type to be useful. - """ - __permissions__ = PUB_SYSTEM_REL_PERMS - -class require_group(RelationType): - """used to grant a permission to a group""" - __permissions__ = PUB_SYSTEM_REL_PERMS - class ExternalUri(EntityType): """a URI representing an object in external data store""" @@ -330,6 +305,24 @@ cardinality = '1*' composite = 'object' + +class CWDataImport(EntityType): + __permissions__ = ENTITY_MANAGERS_PERMISSIONS + start_timestamp = TZDatetime() + end_timestamp = TZDatetime() + log = String() + status = String(required=True, internationalizable=True, indexed=True, + default='in progress', + vocabulary=[_('in progress'), _('success'), _('failed')]) + +class cw_import_of(RelationDefinition): + __permissions__ = RELATION_MANAGERS_PERMISSIONS + subject = 'CWDataImport' + object = 'CWSource' + cardinality = '1*' + composite = 'object' + + class CWSourceSchemaConfig(EntityType): __permissions__ = ENTITY_MANAGERS_PERMISSIONS cw_for_source = SubjectRelation( @@ -382,3 +375,5 @@ 'add': ('managers', RRQLExpression('U has_update_permission S'),), 'delete': ('managers', RRQLExpression('U has_update_permission S'),), } + +