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
This commit is contained in:
Giancarlo Panichi 2019-09-09 15:42:41 +00:00
parent 02e83870c3
commit d7d3a37971
1 changed files with 13 additions and 2 deletions

View File

@ -1762,15 +1762,26 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
break;
}
if (selectedAccessType == null) {
throw new Exception("ACLType parameter is invalid");
}
List<ACL> 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);
}
}
}