git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@179197 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
93113ce220
commit
acbf277683
|
@ -80,7 +80,8 @@ public class UnshareHandler {
|
|||
}
|
||||
|
||||
private String unshareAll(String login, Session ses, SharedFolder item) throws StorageHubException, BackendGenericError, RepositoryException{
|
||||
|
||||
log.info("unshare all called");
|
||||
|
||||
authChecker.checkAdministratorControl(ses, item);
|
||||
if (!login.equals(item.getOwner()))
|
||||
throw new UserNotAuthorizedException("user "+login+" not authorized to unshare all");
|
||||
|
@ -123,7 +124,6 @@ public class UnshareHandler {
|
|||
sharedItemNode.removeSharedSet();
|
||||
ses.save();
|
||||
log.debug("all the users have been removed, the folder is totally unshared");
|
||||
|
||||
return unsharedNode.getIdentifier();
|
||||
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class UnshareHandler {
|
|||
private String unshareCaller(String login, Session ses, SharedFolder item) throws StorageHubException, RepositoryException{
|
||||
|
||||
if (login.equals(item.getOwner()))
|
||||
throw new InvalidCallParameters("the callor is the owner, the folder cannot be unshared");
|
||||
throw new InvalidCallParameters("the caller is the owner, the folder cannot be unshared");
|
||||
|
||||
if (item.getUsers().getMap().get(login)==null)
|
||||
throw new InvalidCallParameters("the folder is not shared with user "+login);
|
||||
|
@ -195,7 +195,7 @@ public class UnshareHandler {
|
|||
|
||||
AccessControlEntry entryToDelete= null;
|
||||
for (AccessControlEntry ace :acls.getAccessControlEntries()) {
|
||||
if (ace.getPrincipal().getName().equals(login)) {
|
||||
if (ace.getPrincipal().getName().equals(user)) {
|
||||
entryToDelete = ace;
|
||||
break;
|
||||
}
|
||||
|
@ -203,9 +203,11 @@ public class UnshareHandler {
|
|||
}
|
||||
if (entryToDelete!=null)
|
||||
acls.removeAccessControlEntry(entryToDelete);
|
||||
|
||||
log.debug("removed Access control entry for user {}",user);
|
||||
}
|
||||
|
||||
log.debug("removed Access control entry for user {}",login);
|
||||
|
||||
Node sharedItemNode = ses.getNodeByIdentifier(item.getId());
|
||||
Node usersNode = sharedItemNode.getNode(NodeConstants.USERS_NAME);
|
||||
usersNode.remove();
|
||||
|
|
Loading…
Reference in New Issue