Skip to content

Commit

Permalink
enable Edit button if you can publish #4139
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Oct 16, 2017
1 parent 445e1ed commit 830fd97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,16 @@ public boolean isLocked() {
}
return false;
}


public boolean isLockedFromEdits() {
// Authors are not allowed to edit but curators are allowed.
if (permissionsWrapper.canIssuePublishDatasetCommand(dataset)) {
return false;
} else {
return true;
}
}

public void setLocked(boolean locked) {
// empty method, so that we can use DatasetPage.locked in a hidden
// input on the page.
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<ui:fragment rendered="#{DatasetPage.sessionUserAuthenticated
and DatasetPage.canUpdateDataset()
and !DatasetPage.dataset.deaccessioned}">
<button type="button" id="editDataSet" class="btn btn-default btn-access dropdown-toggle #{DatasetPage.locked ? 'disabled' : ''}" data-toggle="dropdown">
<button type="button" id="editDataSet" class="btn btn-default btn-access dropdown-toggle #{DatasetPage.lockedFromEdits ? 'disabled' : ''}" data-toggle="dropdown">
<span class="glyphicon glyphicon-pencil"/> #{bundle['dataset.editBtn']} <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right text-left" role="menu">
Expand Down

0 comments on commit 830fd97

Please sign in to comment.