schemas/Bookmark.py
author sylvain.thenault@logilab.fr
Tue, 05 May 2009 19:35:55 +0200
branchtls-sprint
changeset 1700 b5b323f8a05b
parent 1398 5fe84a5f7035
child 1802 d628defebc17
permissions -rw-r--r--
update old_calendar, more needed


class Bookmark(MetaUserEntityType):
    """define an entity type, used to build the application schema"""
    title = String(required=True, maxsize=128)
    path  = String(maxsize=512, required=True,
                   description=_("relative url of the bookmarked page"))
    
    bookmarked_by = SubjectRelation('CWUser',
                                    description=_("users using this bookmark"))
    

class bookmarked_by(MetaUserRelationType):
    permissions = {'read':   ('managers', 'users', 'guests',),
                   # test user in users group to avoid granting permission to anonymous user
                   'add':    ('managers', RRQLExpression('O identity U, U in_group G, G name "users"')),
                   'delete': ('managers', RRQLExpression('O identity U, U in_group G, G name "users"')),
                   }