schemas/Bookmark.py
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 29 Jun 2009 16:04:21 +0200
branchstable
changeset 2191 1f0fde12e35b
parent 2094 59a4e9f4f57a
child 2144 51c84d585456
permissions -rw-r--r--
[rtags] override tag_xxx_of() methods in DisplayCtrlRelationTags to make sure a wildcard is used

"""the Bookmark entity type for internal links

:organization: Logilab
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""

class Bookmark(MetaUserEntityType):
    """bookmarks are used to have user's specific internal links"""
    title = String(required=True, maxsize=128, internationalizable=True)
    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"')),
                   }