# HG changeset patch # User Nicolas Chauvat <nicolas.chauvat@logilab.fr> # Date 1248736159 -7200 # Tue Jul 28 01:09:19 2009 +0200 # Node ID cdd92d221bc5c9f32356ee69a9f17cc58adcd323 # Parent 299e02a0f03f58160ccce5f7d239de5b2aee5fd6 [refactor] import from buildobjs and remove Meta*Entity diff --git a/schema.py b/schema.py --- a/schema.py +++ b/schema.py @@ -3,18 +3,22 @@ :copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ -from yams.buildobjs import (MetaUserEntityType, MetaUserRelationType, - SubjectRelation, RichString) +from yams.buildobjs import EntityType, RelationType, SubjectRelation, RichString from cubicweb.schema import RRQLExpression -class Comment(MetaUserEntityType): +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(MetaUserRelationType): +class comments(RelationType): permissions = { 'read': ('managers', 'users', 'guests'), 'add': ('managers', 'users',),