Fixed bug disabling create buttons if user does not have the proper permissions.
FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
parent
e73c768b9f
commit
f2e07cb07e
1 changed files with 6 additions and 7 deletions
|
|
@ -243,6 +243,8 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
.getFellow("bdFilters");
|
||||
checkIncludeOrderElements = (Checkbox) filterComponent
|
||||
.getFellow("checkIncludeOrderElements");
|
||||
|
||||
checkCreationPermissions();
|
||||
}
|
||||
|
||||
private void initEditOrderElementWindow() {
|
||||
|
|
@ -895,7 +897,6 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
orderModel.prepareForCreate();
|
||||
prepareEditWindow();
|
||||
showEditWindow(_("Create order"));
|
||||
checkCreationPermissions();
|
||||
} catch (ConcurrentModificationException e) {
|
||||
messagesForUser.showMessage(Level.ERROR, e.getMessage());
|
||||
}
|
||||
|
|
@ -1223,14 +1224,12 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
|
||||
/**
|
||||
* Checks the creation permissions of the current user and enables/disables
|
||||
* the save buttons accordingly.
|
||||
* the create buttons accordingly.
|
||||
*/
|
||||
private void checkCreationPermissions() {
|
||||
if(SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_ORDER)) {
|
||||
saveOrderAndContinueButton.setDisabled(false);
|
||||
}
|
||||
else {
|
||||
saveOrderAndContinueButton.setDisabled(true);
|
||||
if (!SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_ORDER)) {
|
||||
createOrderButton.setDisabled(true);
|
||||
createOrderFromTemplateButton.setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue