schemas/Bookmark.py
author sylvain.thenault@logilab.fr
Fri, 03 Apr 2009 19:04:00 +0200
changeset 1228 91ae10ffb611
parent 0 b97547f5f1fa
child 1398 5fe84a5f7035
permissions -rw-r--r--
* refactor ms planner (renaming, reorganization) * fix a bug originaly demonstrated by test_version_depends_on * enhance crossed relation support, though there is still some bug renaming. some tests were actually wrong. Buggy tests (wether they fail or not, they are byggy) marked by XXXFIXME)


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('EUser',
                                    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"')),
                   }