Skip to content

Commit

Permalink
Update UserDialog.java
Browse files Browse the repository at this point in the history
  • Loading branch information
draganjovanovich committed Aug 31, 2015
1 parent 8a7a7c8 commit cd73817
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/java/org/traccar/web/client/view/UserDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public interface UserHandler {

public UserDialog(User user, UserHandler userHandler) {
this.userHandler = userHandler;

// notification types grid
IdentityValueProvider<DeviceEventType> identity = new IdentityValueProvider<DeviceEventType>();
final CheckBoxSelectionModel<DeviceEventType> selectionModel = new CheckBoxSelectionModel<DeviceEventType>(identity);
Expand Down Expand Up @@ -152,15 +151,20 @@ public String getValue(DeviceEventType object) {
grid.getSelectionModel().select(deviceEventType, true);
}

if (ApplicationContext.getInstance().getUser().getAdmin()) {
if (ApplicationContext.getInstance().getUser().getAdmin() || ApplicationContext.getInstance().getUser().getManager()) {
admin.setEnabled(true);
}

if (ApplicationContext.getInstance().getUser().getAdmin() ||
ApplicationContext.getInstance().getUser().getManager()) {
manager.setEnabled(true);
readOnly.setEnabled(true);
expirationDate.setEnabled(true);
maxNumOfDevices.setEnabled(true);
}
else {
manager.setEnabled(false);
admin.setEnabled(false);
readOnly.setEnabled(false);
expirationDate.setEnabled(false);
maxNumOfDevices.setEnabled(false);
}

email.addValidator(new RegExValidator(".+@.+\\.[a-z]+", i18n.invalidEmail()));

driver.initialize(this);
Expand Down

0 comments on commit cd73817

Please sign in to comment.