Revision 16580b3c
Added by Andreas Kohlbecker about 5 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java | ||
---|---|---|
438 | 438 |
|
439 | 439 |
|
440 | 440 |
if(UserHelperAccess.userHelper().userIs(new RoleProber(RolesAndPermissions.ROLE_CURATION)) || UserHelperAccess.userHelper().userIsAdmin()) { |
441 |
|
|
441 | 442 |
Button editRegistrationButton = new Button(FontAwesome.COG); |
442 | 443 |
editRegistrationButton.setStyleName(ValoTheme.BUTTON_TINY); |
443 | 444 |
editRegistrationButton.setDescription("Edit registration"); |
... | ... | |
448 | 449 |
null, |
449 | 450 |
this |
450 | 451 |
))); |
451 |
regItemButtons.addComponent(editRegistrationButton); |
|
452 |
|
|
453 |
Button unlockButton = new Button(FontAwesome.LOCK); |
|
454 |
unlockButton.setStyleName(ValoTheme.BUTTON_TINY); |
|
455 |
unlockButton.setDescription("Unlock"); |
|
456 |
unlockButton.addClickListener(e -> { |
|
457 |
regItemButtonGroup.setLockOverride(!regItemButtonGroup.isLockOverride()); |
|
458 |
if(regItemButtonGroup.isRegistrationLocked()){ |
|
459 |
unlockButton.setIcon(regItemButtonGroup.isLockOverride() ? FontAwesome.UNLOCK_ALT : FontAwesome.LOCK); |
|
460 |
unlockButton.setDescription(regItemButtonGroup.isLockOverride() ? "Click to unlock editing" : "Click to lock editing"); |
|
461 |
} |
|
462 |
}); |
|
463 |
unlockButton.setEnabled(regItemButtonGroup.isRegistrationLocked()); |
|
464 |
regItemButtons.addComponents(unlockButton, editRegistrationButton); |
|
452 | 465 |
} |
453 | 466 |
|
454 | 467 |
PermissionDebugUtils.addGainPerEntityPermissionButton(regItemButtons, Registration.class, dto.getUuid(), |
Also available in: Unified diff
ref #8192 unlock button to allow curator and admin to edit published Registrations