diff --git a/schema.py b/schema.py index 299e02a0f03f58160ccce5f7d239de5b2aee5fd6_c2NoZW1hLnB5..cdd92d221bc5c9f32356ee69a9f17cc58adcd323_c2NoZW1hLnB5 100644 --- a/schema.py +++ b/schema.py @@ -3,8 +3,7 @@ :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 @@ -8,5 +7,5 @@ from cubicweb.schema import RRQLExpression -class Comment(MetaUserEntityType): +class Comment(EntityType): """a comment is a reply about another entity""" @@ -12,2 +11,8 @@ """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) @@ -13,4 +18,3 @@ content = RichString(required=True, fulltextindexed=True) - comments = SubjectRelation('Comment', cardinality='1*', composite='object') @@ -15,6 +19,6 @@ comments = SubjectRelation('Comment', cardinality='1*', composite='object') -class comments(MetaUserRelationType): +class comments(RelationType): permissions = { 'read': ('managers', 'users', 'guests'), 'add': ('managers', 'users',),