From a66702384b9fccfc20034075107a0bb7d5a2e3f3 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Tue, 22 Sep 2015 13:05:55 +0000
Subject: [PATCH] SSDM-2459: Set parent roles for addParentToSample() and
 removeParentFromSample() in IRelationshipService.

SVN: 34689
---
 .../generic/server/business/IRelationshipService.java       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java
index 0a9a659db5d..907b5ce656d 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java
@@ -139,7 +139,8 @@ public interface IRelationshipService
     @Capability("ADD_PARENT_TO_SAMPLE")
     public void addParentToSample(IAuthSession session,
             @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class)
-            SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class)
+            SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class,
+                    rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER })
             SamplePE parent);
 
     @Transactional(propagation = Propagation.MANDATORY)
@@ -148,7 +149,8 @@ public interface IRelationshipService
     @Capability("REMOVE_PARENT_FROM_SAMPLE")
     public void removeParentFromSample(IAuthSession session,
             @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class)
-            SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class)
+            SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class,
+                    rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER })
             SamplePE parent);
 
     @Transactional(propagation = Propagation.MANDATORY)
-- 
GitLab