DS-3446: Remove policies only after the bitstream has been updated (otherwise the current user has not WRITE rights)

This commit is contained in:
Tom Desair
2017-01-09 22:53:52 +01:00
committed by Kim Shepherd
parent 190cbd5d76
commit 41deb20043

View File

@@ -254,13 +254,13 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
bundle.getBitstreams().remove(bitstream);
}
// Remove policies
authorizeService.removeAllPolicies(context, bitstream);
// Remove bitstream itself
bitstream.setDeleted(true);
update(context, bitstream);
// Remove policies only after the bitstream has been updated (otherwise the current user has not WRITE rights)
authorizeService.removeAllPolicies(context, bitstream);
//Remove all bundles from the bitstream object, clearing the connection in 2 ways
bundles.clear();
}