[DS-3125] Submitters cannot delete bistreams of workspaceitems

This commit is contained in:
KevinVdV
2016-04-15 13:00:37 +02:00
parent b1e32fc1a7
commit bc9798c753
9 changed files with 86 additions and 6 deletions

View File

@@ -238,7 +238,7 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
@Override
public void delete(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
// changed to a check on remove
// changed to a check on delete
// Check authorisation
authorizeService.authorizeAction(context, bitstream, Constants.DELETE);
log.info(LogManager.getHeader(context, "delete_bitstream",
@@ -249,15 +249,13 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
bitstream.getBundles().clear();
// Remove policies
authorizeService.removeAllPolicies(context, bitstream);
deleteMetadata(context, bitstream);
// Remove bitstream itself
bitstream.setDeleted(true);
update(context, bitstream);
// Remove policies from the file, we do this at the end since the methods above still require write rights.
authorizeService.removeAllPolicies(context, bitstream);
}
@Override