ref 17169: Selection of users in the Sharing panel
https://support.d4science.org/issues/17169 Updated the administrator support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181653 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2c79de679f
commit
a7c98130e4
|
@ -833,15 +833,46 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("Update ACL for add Administrators");
|
||||
|
||||
logger.debug("Share with new Administrators");
|
||||
HashSet<String> shareUsers = new HashSet<>();
|
||||
boolean alreadyShared;
|
||||
for (String user : listContactLogins) {
|
||||
if (currentUser.compareTo(user) != 0) {
|
||||
folderContainer = folderContainer.changeAcls(user, AccessType.ADMINISTRATOR);
|
||||
alreadyShared = false;
|
||||
for (ACL acl : acls) {
|
||||
if (user.compareTo(acl.getPricipal()) == 0) {
|
||||
alreadyShared = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!alreadyShared) {
|
||||
shareUsers.add(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("Update ACL for add Administrators");
|
||||
if (shareUsers.isEmpty()) {
|
||||
for (String user : listContactLogins) {
|
||||
if (currentUser.compareTo(user) != 0) {
|
||||
folderContainer = folderContainer.changeAcls(user, AccessType.ADMINISTRATOR);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
folderContainer = folderContainer.share(shareUsers, AccessType.ADMINISTRATOR);
|
||||
HashSet<String> aclUpdateUsers = new HashSet<>(listContactLogins);
|
||||
aclUpdateUsers.removeAll(shareUsers);
|
||||
for (String user : aclUpdateUsers) {
|
||||
if (currentUser.compareTo(user) != 0) {
|
||||
folderContainer = folderContainer.changeAcls(user, AccessType.ADMINISTRATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.debug("Update Administrators done");
|
||||
|
||||
|
||||
|
||||
logger.debug("Update Administrators done");
|
||||
if (!alreadyAdministrators.isEmpty()) {
|
||||
alreadyAdministrators.removeAll(listContactLogins);
|
||||
if (!alreadyAdministrators.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue