Skip to content

Commit

Permalink
reuse checkInReviewEditLock method (check for locks) #4139
Browse files Browse the repository at this point in the history
We want to make sure people who can legitimately edit datasets can still
do so.
  • Loading branch information
pdurbin committed Oct 16, 2017
1 parent b2cf086 commit 360c249
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import java.util.logging.Level;
import edu.harvard.iq.dataverse.datasetutility.TwoRavensHelper;
import edu.harvard.iq.dataverse.datasetutility.WorldMapPermissionHelper;
import edu.harvard.iq.dataverse.engine.command.exception.IllegalCommandException;
import edu.harvard.iq.dataverse.engine.command.impl.RequestRsyncScriptCommand;
import edu.harvard.iq.dataverse.engine.command.impl.PublishDatasetResult;
import edu.harvard.iq.dataverse.engine.command.impl.RestrictFileCommand;
Expand Down Expand Up @@ -2662,13 +2663,16 @@ public boolean isLocked() {
return false;
}

/**
* Authors are not allowed to edit but curators are allowed.
*/
public boolean isLockedFromEdits() {
// Authors are not allowed to edit but curators are allowed.
if (permissionsWrapper.canIssuePublishDatasetCommand(dataset)) {
return false;
} else {
try {
permissionService.checkInReviewEditLock(dataset, dvRequestService.getDataverseRequest(), new UpdateDatasetCommand(dataset, dvRequestService.getDataverseRequest()));
} catch (IllegalCommandException ex) {
return true;
}
return false;
}

public void setLocked(boolean locked) {
Expand Down

0 comments on commit 360c249

Please sign in to comment.