#1347584: when used as a tracker extension, should grant staff group the right to add/update repositories
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Oct 2010 18:01:10 +0200
changeset 716 448d9fb3ae71
parent 715 52a9fd8e9380
child 717 8f4bbf01b25d
#1347584: when used as a tracker extension, should grant staff group the right to add/update repositories
migration/2.0.5_Any.py
schema.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/migration/2.0.5_Any.py	Thu Oct 21 18:01:10 2010 +0200
@@ -0,0 +1,1 @@
+sync_schema_props_perms('Repository')
--- a/schema.py	Thu Oct 21 18:00:06 2010 +0200
+++ b/schema.py	Thu Oct 21 18:01:10 2010 +0200
@@ -57,8 +57,13 @@
 # configuration entities and relations #########################################
 
 def post_build_callback(schema):
-    if not 'narval' in schema['Repository'].permissions['read']:
-        schema['Repository'].permissions['read'] += ('narval',)
+    repoperms = schema['Repository'].permissions
+    if not 'narval' in repoperms['read']:
+        repoperms['read'] += ('narval',)
+    for permission in ('add', 'update', 'delete'):
+        for group in CONF_WRITE_GROUPS:
+            if not group in repoperms[permission]:
+                repoperms[permission] += (group,)
     for attr in ('path', 'local_cache'):
         rdef = schema['Repository'].rdef(attr)
         if not 'narval' in rdef.permissions['read']: