diff options
author | Anton Tananaev <anton@traccar.org> | 2022-02-21 17:33:58 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-04-05 15:48:51 -0700 |
commit | 9ec2d09ad8a757d58f70812b9cf5e835321382e6 (patch) | |
tree | 3632335375c62d7e30d32c49b9d952af3eb0b748 /src/main/java/org/traccar/model | |
parent | 307c4dd690c5826e076657fa83f2ddd41cec1126 (diff) | |
download | trackermap-server-9ec2d09ad8a757d58f70812b9cf5e835321382e6.tar.gz trackermap-server-9ec2d09ad8a757d58f70812b9cf5e835321382e6.tar.bz2 trackermap-server-9ec2d09ad8a757d58f70812b9cf5e835321382e6.zip |
Migrate permissions to storage
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r-- | src/main/java/org/traccar/model/Permission.java | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/model/User.java | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/model/Permission.java b/src/main/java/org/traccar/model/Permission.java index ad0176b39..bace6b7d4 100644 --- a/src/main/java/org/traccar/model/Permission.java +++ b/src/main/java/org/traccar/model/Permission.java @@ -71,7 +71,7 @@ public class Permission { data.put(getKey(propertyClass), propertyId); } - private static String getKey(Class<?> clazz) { + public static String getKey(Class<?> clazz) { return Introspector.decapitalize(clazz.getSimpleName()) + "Id"; } diff --git a/src/main/java/org/traccar/model/User.java b/src/main/java/org/traccar/model/User.java index 464d0cbfe..6a67f3276 100644 --- a/src/main/java/org/traccar/model/User.java +++ b/src/main/java/org/traccar/model/User.java @@ -79,6 +79,12 @@ public class User extends ExtendedModel { private boolean administrator; + @QueryIgnore + @JsonIgnore + public boolean getManager() { + return userLimit != 0; + } + public boolean getAdministrator() { return administrator; } |