mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 18:44:22 +00:00
[DS-3179] Collection admin, edit item no authorization to remove file in JSPUI
This commit is contained in:
@@ -170,8 +170,6 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
||||
log.info(LogManager.getHeader(context, "remove_bitstream",
|
||||
"bundle_id=" + bundle.getID() + ",bitstream_id=" + bitstream.getID()));
|
||||
|
||||
bundle.getBitstreams().remove(bitstream);
|
||||
bitstream.getBundles().remove(bundle);
|
||||
|
||||
context.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, bundle.getID(),
|
||||
Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
|
||||
@@ -193,7 +191,16 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
||||
bundle.unsetPrimaryBitstreamID();
|
||||
}
|
||||
|
||||
bitstreamService.delete(context, bitstream);
|
||||
// Check if we our bitstream is part of a single bundle:
|
||||
// If so delete it, if not then remove the link between bundle & bitstream
|
||||
if(bitstream.getBundles().size() == 1)
|
||||
{
|
||||
// We don't need to remove the link between bundle & bitstream, this will be handled in the delete() method.
|
||||
bitstreamService.delete(context, bitstream);
|
||||
}else{
|
||||
bundle.getBitstreams().remove(bitstream);
|
||||
bitstream.getBundles().remove(bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user