From 4aea55186a2374350f825cf2008847ce4c5ae87c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 27 Apr 2018 17:06:27 +1200 Subject: Rename admin to administrator (fix #3858) --- src/org/traccar/database/LdapProvider.java | 2 +- src/org/traccar/database/PermissionsManager.java | 4 ++-- src/org/traccar/model/User.java | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/org/traccar/database/LdapProvider.java b/src/org/traccar/database/LdapProvider.java index 44dd386ed..eb975ad0f 100644 --- a/src/org/traccar/database/LdapProvider.java +++ b/src/org/traccar/database/LdapProvider.java @@ -150,7 +150,7 @@ public class LdapProvider { user.setEmail(accountName); } } - user.setAdmin(isAdmin(accountName)); + user.setAdministrator(isAdmin(accountName)); } catch (NamingException e) { user.setLogin(accountName); user.setName(accountName); diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index b5f062d2b..1c19f2374 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -156,7 +156,7 @@ public class PermissionsManager { public boolean getUserAdmin(long userId) { User user = getUser(userId); - return user != null && user.getAdmin(); + return user != null && user.getAdministrator(); } public void checkAdmin(long userId) throws SecurityException { @@ -258,7 +258,7 @@ public class PermissionsManager { } public void checkUserUpdate(long userId, User before, User after) throws SecurityException { - if (before.getAdmin() != after.getAdmin() + if (before.getAdministrator() != after.getAdministrator() || before.getDeviceLimit() != after.getDeviceLimit() || before.getUserLimit() != after.getUserLimit()) { checkAdmin(userId); diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java index 1a131a4e8..99e12a072 100644 --- a/src/org/traccar/model/User.java +++ b/src/org/traccar/model/User.java @@ -75,14 +75,14 @@ public class User extends ExtendedModel { this.readonly = readonly; } - private boolean admin; + private boolean administrator; - public boolean getAdmin() { - return admin; + public boolean getAdministrator() { + return administrator; } - public void setAdmin(boolean admin) { - this.admin = admin; + public void setAdministrator(boolean administrator) { + this.administrator = administrator; } private String map; -- cgit v1.2.3