Skip to content

Commit

Permalink
Disallow edit of Specimen marked as 'Specialist Reviewed'
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Sep 20, 2021
1 parent c97802d commit 8e9c649
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/edu/harvard/mcz/imagecapture/entity/Specimen.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,17 @@ public Boolean isExported() {
}

public Boolean isEditable(Users user) {
return !this.isExported();
boolean canEdit = !this.isExported();
if (user != null) {
canEdit = canEdit && (user.isUserRole(Users.ROLE_FULL) || user.isUserRole(Users.ROLE_ADMINISTRATOR) || this.getTypeStatus() != WorkFlowStatus.STAGE_CLEAN);
} else {
canEdit = canEdit && this.getTypeStatus() != WorkFlowStatus.STAGE_CLEAN;
}
return canEdit;
}

public Boolean isEditable() {
return this.isEditable(null);
return this.isEditable(Singleton.getSingletonInstance().getUser());
}

public String getPrimaryDivisonISO() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class WorkFlowStatus {
/**
* State change for a specimen record indicating that the specimen record that
* has been reviewed by a taxonomist.
* Record is now only editable by Admins.
*/
public static final String STAGE_CLEAN = "Specialist Reviewed";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,11 @@ private JMenu getJMenuData() {
return jMenuData;
}

/**
* This method initializes the menu item for batch updates
*
* @return
*/
private JMenuItem getJMenuItemBatchUpdate() {
if (jMenuItemBatchUpdate == null) {
jMenuItemBatchUpdate = new JMenuItem("Batch Update");
Expand Down

0 comments on commit 8e9c649

Please sign in to comment.