author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Tue, 09 Jun 2009 18:46:20 +0200 | |
branch | stable |
changeset 2077 | 50beca829273 |
parent 1977 | 606923dff11b |
child 2094 | 59a4e9f4f57a |
child 2140 | 1cba3393ba01 |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
|
9 |
class Bookmark(MetaUserEntityType): |
|
10 |
"""define an entity type, used to build the application schema""" |
|
11 |
title = String(required=True, maxsize=128) |
|
12 |
path = String(maxsize=512, required=True, |
|
13 |
description=_("relative url of the bookmarked page")) |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
14 |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
15 |
bookmarked_by = SubjectRelation('CWUser', |
0 | 16 |
description=_("users using this bookmark")) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
17 |
|
0 | 18 |
|
19 |
class bookmarked_by(MetaUserRelationType): |
|
20 |
permissions = {'read': ('managers', 'users', 'guests',), |
|
21 |
# test user in users group to avoid granting permission to anonymous user |
|
22 |
'add': ('managers', RRQLExpression('O identity U, U in_group G, G name "users"')), |
|
23 |
'delete': ('managers', RRQLExpression('O identity U, U in_group G, G name "users"')), |
|
24 |
} |