Skip to content

Commit

Permalink
Corrected access checks for #215 and #252
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalidze committed Sep 8, 2015
1 parent 8bb189e commit 5e76b87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/traccar/web/client/view/UserDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ public String getValue(DeviceEventType object) {
grid.getSelectionModel().select(deviceEventType, true);
}

if (ApplicationContext.getInstance().getUser().getAdmin() || ApplicationContext.getInstance().getUser().getManager()) {
admin.setEnabled(true);
User currentUser = ApplicationContext.getInstance().getUser();
if (currentUser.getAdmin() || currentUser.getManager()) {
admin.setEnabled(currentUser.getAdmin());
manager.setEnabled(true);
readOnly.setEnabled(true);
expirationDate.setEnabled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ public User updateUser(User user) {
{
currentUser.setMaxNumOfDevices(user.getMaxNumOfDevices());
currentUser.setExpirationDate(user.getExpirationDate());
currentUser.setAdmin(user.getAdmin());
if (currentUser.getAdmin()) {
currentUser.setAdmin(user.getAdmin());
}
currentUser.setManager(user.getManager());
}
currentUser.setUserSettings(user.getUserSettings());
Expand Down

0 comments on commit 5e76b87

Please sign in to comment.