fix see_also permissions 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 17 Sep 2009 09:51:39 +0200
branch3.5
changeset 3277 4fdb165ae3de
parent 3276 4480887772a3
child 3278 293068aeee41
fix see_also permissions
misc/migration/3.5.0_Any.py
schemas/base.py
--- a/misc/migration/3.5.0_Any.py	Thu Sep 17 09:49:13 2009 +0200
+++ b/misc/migration/3.5.0_Any.py	Thu Sep 17 09:51:39 2009 +0200
@@ -5,3 +5,6 @@
 
 drop_attribute('EmailAddress', 'canonical')
 drop_relation_definition('EmailAddress', 'identical_to', 'EmailAddress')
+
+if 'see_also' in schema:
+    sync_schema_props_perms('see_also', syncprops=False, syncrdefs=False)
--- a/schemas/base.py	Thu Sep 17 09:49:13 2009 +0200
+++ b/schemas/base.py	Thu Sep 17 09:51:39 2009 +0200
@@ -269,3 +269,8 @@
 class see_also(RelationType):
     """generic relation to link one entity to another"""
     symetric = True
+    permissions = {
+        'read':   ('managers', 'users', 'guests',),
+        'add':    ('managers', RRQLExpression('U has_update_permission S'),),
+        'delete': ('managers', RRQLExpression('U has_update_permission S'),),
+        }