update for test issue

This commit is contained in:
Lucio Lelii 2020-04-23 16:09:13 +02:00
parent f2742ce0e0
commit 70ae49e28d
3 changed files with 31 additions and 31 deletions

View File

@ -15,7 +15,6 @@ import org.apache.jackrabbit.api.security.user.Group;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.storagehub.model.Excludes;
import org.gcube.common.storagehub.model.Paths;
import org.gcube.common.storagehub.model.acls.AccessType;
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
import org.gcube.common.storagehub.model.exceptions.InvalidCallParameters;
@ -128,8 +127,9 @@ public class AuthorizationChecker {
if (Constants.WRITE_PROTECTED_FOLDER.contains(item.getName()) || Constants.WRITE_PROTECTED_FOLDER.contains(item.getTitle()))
throw new UserNotAuthorizedException("Insufficent Privileges for user "+login+" to write into node with id "+item.getId()+": it's a protected folder");
/*
if (item.isTrashed())
throw new UserNotAuthorizedException("Trashed item cannot be written");
throw new UserNotAuthorizedException("Trashed item cannot be written");*/
if (item.isShared()) {
Node parentSharedNode = retrieveSharedFolderParent(node, session);

View File

@ -1160,11 +1160,11 @@ public class ItemsManager {
//TODO check if it is possible to change all the ACL on a workspace
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
authChecker.checkMoveOpsForProtectedFolders(ses, id);
authChecker.checkWriteAuthorizationControl(ses, id, false);
authChecker.checkMoveOpsForProtectedFolders(ses, id);
final Node nodeToDelete = ses.getNodeByIdentifier(id);
Item itemToDelete = node2Item.getItem(nodeToDelete, Excludes.GET_ONLY_CONTENT);
if (itemToDelete instanceof SharedFolder || itemToDelete instanceof VreFolder || (itemToDelete instanceof FolderItem && Utils.hasSharedChildren(nodeToDelete)))
@ -1172,9 +1172,9 @@ public class ItemsManager {
log.debug("item is trashed? {}", itemToDelete.isTrashed());
if (!itemToDelete.isTrashed() && !force)
if (!itemToDelete.isTrashed() && !force) {
trashHandler.moveToTrash(ses, nodeToDelete, itemToDelete);
else
}else
trashHandler.removeNodes(ses, Collections.singletonList(itemToDelete));
}catch (LockException e) {

View File

@ -25,7 +25,7 @@ The projects leading to this software have received funding from a series of
Version
--------------------------------------------------
1.2.0-SNAPSHOT (2020-04-17)
1.2.0-SNAPSHOT (2020-04-23)
Please see the file named "changelog.xml" in this directory for the release notes.