update for test issue
This commit is contained in:
parent
f2742ce0e0
commit
70ae49e28d
|
@ -15,7 +15,6 @@ import org.apache.jackrabbit.api.security.user.Group;
|
||||||
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
|
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
|
||||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||||
import org.gcube.common.storagehub.model.Excludes;
|
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.acls.AccessType;
|
||||||
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
|
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
|
||||||
import org.gcube.common.storagehub.model.exceptions.InvalidCallParameters;
|
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()))
|
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");
|
throw new UserNotAuthorizedException("Insufficent Privileges for user "+login+" to write into node with id "+item.getId()+": it's a protected folder");
|
||||||
|
|
||||||
|
/*
|
||||||
if (item.isTrashed())
|
if (item.isTrashed())
|
||||||
throw new UserNotAuthorizedException("Trashed item cannot be written");
|
throw new UserNotAuthorizedException("Trashed item cannot be written");*/
|
||||||
|
|
||||||
if (item.isShared()) {
|
if (item.isShared()) {
|
||||||
Node parentSharedNode = retrieveSharedFolderParent(node, session);
|
Node parentSharedNode = retrieveSharedFolderParent(node, session);
|
||||||
|
|
|
@ -1160,11 +1160,11 @@ public class ItemsManager {
|
||||||
|
|
||||||
//TODO check if it is possible to change all the ACL on a workspace
|
//TODO check if it is possible to change all the ACL on a workspace
|
||||||
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
|
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
|
||||||
authChecker.checkMoveOpsForProtectedFolders(ses, id);
|
|
||||||
authChecker.checkWriteAuthorizationControl(ses, id, false);
|
authChecker.checkWriteAuthorizationControl(ses, id, false);
|
||||||
|
authChecker.checkMoveOpsForProtectedFolders(ses, id);
|
||||||
|
|
||||||
final Node nodeToDelete = ses.getNodeByIdentifier(id);
|
final Node nodeToDelete = ses.getNodeByIdentifier(id);
|
||||||
|
|
||||||
Item itemToDelete = node2Item.getItem(nodeToDelete, Excludes.GET_ONLY_CONTENT);
|
Item itemToDelete = node2Item.getItem(nodeToDelete, Excludes.GET_ONLY_CONTENT);
|
||||||
|
|
||||||
if (itemToDelete instanceof SharedFolder || itemToDelete instanceof VreFolder || (itemToDelete instanceof FolderItem && Utils.hasSharedChildren(nodeToDelete)))
|
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());
|
log.debug("item is trashed? {}", itemToDelete.isTrashed());
|
||||||
|
|
||||||
if (!itemToDelete.isTrashed() && !force)
|
if (!itemToDelete.isTrashed() && !force) {
|
||||||
trashHandler.moveToTrash(ses, nodeToDelete, itemToDelete);
|
trashHandler.moveToTrash(ses, nodeToDelete, itemToDelete);
|
||||||
else
|
}else
|
||||||
trashHandler.removeNodes(ses, Collections.singletonList(itemToDelete));
|
trashHandler.removeNodes(ses, Collections.singletonList(itemToDelete));
|
||||||
|
|
||||||
}catch (LockException e) {
|
}catch (LockException e) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ The projects leading to this software have received funding from a series of
|
||||||
Version
|
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.
|
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue