From d7d3a37971b78e9b1e967819c3e62336a9886adf Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 9 Sep 2019 15:42:41 +0000 Subject: [PATCH] ref 17169: Selection of users in the Sharing panel https://support.d4science.org/issues/17169 Updated DialogPermission to support SH calls git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181590 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/WorkspaceSharingServiceImpl.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/WorkspaceSharingServiceImpl.java b/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/WorkspaceSharingServiceImpl.java index d53eba1..e8d1fb3 100644 --- a/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/WorkspaceSharingServiceImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/WorkspaceSharingServiceImpl.java @@ -1762,15 +1762,26 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements break; } - + if (selectedAccessType == null) { throw new Exception("ACLType parameter is invalid"); } List acls = folderContainer.getAcls(); + boolean isAdmin; for (ACL acl : acls) { if (acl.getPricipal().compareTo(currentUser) != 0) { - folderContainer = folderContainer.changeAcls(acl.getPricipal(), selectedAccessType); + isAdmin = false; + for (AccessType accessType : acl.getAccessTypes()) { + if (accessType.compareTo(AccessType.ADMINISTRATOR) == 0) { + isAdmin = true; + break; + } + } + + if (!isAdmin) { + folderContainer = folderContainer.changeAcls(acl.getPricipal(), selectedAccessType); + } } }