mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
Merge pull request #2047 from kshepherd/ds-2862_fix_legacy_embargo_checks_master_port
[DS-2862] Apply DSPR#2000 changes manually and fix style for master port
This commit is contained in:
@@ -168,16 +168,19 @@ public class DefaultEmbargoSetter implements EmbargoSetter {
|
|||||||
// check for ANY read policies and report them:
|
// check for ANY read policies and report them:
|
||||||
for (ResourcePolicy rp : getAuthorizeService()
|
for (ResourcePolicy rp : getAuthorizeService()
|
||||||
.getPoliciesActionFilter(context, bn, Constants.READ)) {
|
.getPoliciesActionFilter(context, bn, Constants.READ)) {
|
||||||
|
if (rp.getStartDate() == null) {
|
||||||
System.out.println("CHECK WARNING: Item " + item.getHandle() + ", Bundle " + bn
|
System.out.println("CHECK WARNING: Item " + item.getHandle() + ", Bundle " + bn
|
||||||
.getName() + " allows READ by " +
|
.getName() + " allows READ by " +
|
||||||
((rp.getEPerson() != null) ? "Group " + rp.getGroup().getName() :
|
((rp.getEPerson() != null) ? "Group " + rp.getGroup().getName() :
|
||||||
"EPerson " + rp.getEPerson().getFullName()));
|
"EPerson " + rp.getEPerson().getFullName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Bitstream bs : bn.getBitstreams()) {
|
for (Bitstream bs : bn.getBitstreams()) {
|
||||||
for (ResourcePolicy rp : getAuthorizeService()
|
for (ResourcePolicy rp : getAuthorizeService()
|
||||||
.getPoliciesActionFilter(context, bs, Constants.READ)) {
|
.getPoliciesActionFilter(context, bs, Constants.READ)) {
|
||||||
|
if (rp.getStartDate() == null) {
|
||||||
System.out.println("CHECK WARNING: Item " + item.getHandle() + ", Bitstream " + bs
|
System.out.println("CHECK WARNING: Item " + item.getHandle() + ", Bitstream " + bs
|
||||||
.getName() + " (in Bundle " + bn.getName() + ") allows READ by " +
|
.getName() + " (in Bundle " + bn.getName() + ") allows READ by " +
|
||||||
((rp.getEPerson() != null) ? "Group " + rp.getGroup().getName() :
|
((rp.getEPerson() != null) ? "Group " + rp.getGroup().getName() :
|
||||||
@@ -187,6 +190,7 @@ public class DefaultEmbargoSetter implements EmbargoSetter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private AuthorizeService getAuthorizeService() {
|
private AuthorizeService getAuthorizeService() {
|
||||||
if (authorizeService == null) {
|
if (authorizeService == null) {
|
||||||
|
@@ -147,8 +147,9 @@ public class EmbargoServiceImpl implements EmbargoService {
|
|||||||
@Override
|
@Override
|
||||||
public void liftEmbargo(Context context, Item item)
|
public void liftEmbargo(Context context, Item item)
|
||||||
throws SQLException, AuthorizeException, IOException {
|
throws SQLException, AuthorizeException, IOException {
|
||||||
// new version of Embargo policies remain in place.
|
// Since 3.0 the lift process for all embargoes is performed through the dates
|
||||||
//lifter.liftEmbargo(context, item);
|
// on the authorization process (see DS-2588)
|
||||||
|
// lifter.liftEmbargo(context, item);
|
||||||
itemService.clearMetadata(context, item, lift_schema, lift_element, lift_qualifier, Item.ANY);
|
itemService.clearMetadata(context, item, lift_schema, lift_element, lift_qualifier, Item.ANY);
|
||||||
|
|
||||||
// set the dc.date.available value to right now
|
// set the dc.date.available value to right now
|
||||||
|
Reference in New Issue
Block a user