schemas/Bookmark.py
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 28 May 2009 19:07:06 +0200
branchstable
changeset 1992 b073057c2756
parent 1802 d628defebc17
child 1977 606923dff11b
permissions -rw-r--r--
[javascript] fix AJAX user preference validation - use $elt.val() instead of $elt.attr('value') - fix radio button handling


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