[PATCH 5 of 5 seda] Remove special case handling of clone_of when setting permissions

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Apr 11 15:12:34 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1491833770 -7200
#      Mon Apr 10 16:16:10 2017 +0200
# Node ID 1c2fedd574684c1cd7bc7c029b5e0c6e6d253671
# Parent  1cd617d62c1e23b8872cc422fde8b7d40943a9bc
Remove special case handling of clone_of when setting permissions

It should simply be skipped by adding it to GRAPH_SKIP_RTYPES.

diff --git a/cubicweb_seda/__init__.py b/cubicweb_seda/__init__.py
--- a/cubicweb_seda/__init__.py
+++ b/cubicweb_seda/__init__.py
@@ -21,11 +21,11 @@ Data Exchange Standard for Archival
 from cubicweb_compound import skip_rtypes_set, structure_def, CompositeGraph
 
 
 # control of compound graph by adding etype / rtype to the corresponding set below
 GRAPH_SKIP_ETYPES = set()
-GRAPH_SKIP_RTYPES = set(['container'])
+GRAPH_SKIP_RTYPES = set(['container', 'clone_of'])
 
 
 def seda_profile_container_def(schema):
     """Define container for SEDAArchiveTransfer, as a list of (etype, parent_rdefs)."""
     return structure_def(schema, 'SEDAArchiveTransfer',
diff --git a/cubicweb_seda/schema/__init__.py b/cubicweb_seda/schema/__init__.py
--- a/cubicweb_seda/schema/__init__.py
+++ b/cubicweb_seda/schema/__init__.py
@@ -194,12 +194,10 @@ def post_build_callback(schema):
                      ERQLExpression('NOT EXISTS(X container C), U in_group G, '
                                     'G name IN ("managers", "users")')))
     # set permissions on all relation defs related to the compound graph according to permission on
     # the container entity
     for rdef, role in iter_all_rdefs(schema, 'SEDAArchiveTransfer'):
-        if rdef.rtype == 'clone_of':
-            continue
         if role == 'subject':
             target_etype, var = rdef.subject, 'S'
         else:
             target_etype, var = rdef.object, 'O'
         rrql_exprs = []


More information about the saem-devel mailing list