Skip to content

Commit

Permalink
IQSS#4139 Allow "update dataset" perms to download files of in review…
Browse files Browse the repository at this point in the history
… datasets.
  • Loading branch information
sekmiller committed Nov 2, 2017
1 parent 08fd6f6 commit 2442b3f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import edu.harvard.iq.dataverse.engine.command.exception.IllegalCommandException;
import edu.harvard.iq.dataverse.engine.command.impl.CreateDatasetCommand;
import edu.harvard.iq.dataverse.engine.command.impl.PublishDatasetCommand;
import edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetCommand;
import edu.harvard.iq.dataverse.util.BundleUtil;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -568,8 +569,8 @@ public void checkEditDatasetLock(Dataset dataset, DataverseRequest dataverseRequ
public void checkDownloadFileLock(Dataset dataset, DataverseRequest dataverseRequest, Command command) throws IllegalCommandException {
if (dataset.isLocked()) {
if (dataset.isLockedFor(DatasetLock.Reason.InReview)) {
// The "InReview" lock is not really a lock for curators or contributors. They can still download.
if (!isUserAllowedOn(dataverseRequest.getUser(), new CreateDatasetCommand(dataset, dataverseRequest, true), dataset)) {
// The "InReview" lock is not really a lock for curators or contributors. They can still download.
if (!isUserAllowedOn(dataverseRequest.getUser(), new UpdateDatasetCommand(dataset, dataverseRequest), dataset)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.downloadNotAllowedInReview"), command);
}
}
Expand Down

0 comments on commit 2442b3f

Please sign in to comment.