aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-22 10:55:48 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-22 10:55:48 -0700
commit9f8a78e5b7afddc6ccb0a54f4b3e59e1395de8eb (patch)
tree26356ca17e21d626843671aac23bf775c6451359 /src/main/java/org/traccar/database/PermissionsManager.java
parentd9f51795058399e85ae83a8e308a0c2bc1d13e4b (diff)
parent9c9f5d66147cfa428ea18dd29103b9c82e529dca (diff)
downloadtrackermap-server-9f8a78e5b7afddc6ccb0a54f4b3e59e1395de8eb.tar.gz
trackermap-server-9f8a78e5b7afddc6ccb0a54f4b3e59e1395de8eb.tar.bz2
trackermap-server-9f8a78e5b7afddc6ccb0a54f4b3e59e1395de8eb.zip
Merge branch 'storage'
Diffstat (limited to 'src/main/java/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/main/java/org/traccar/database/PermissionsManager.java22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/main/java/org/traccar/database/PermissionsManager.java b/src/main/java/org/traccar/database/PermissionsManager.java
index 2bb808033..9a673c784 100644
--- a/src/main/java/org/traccar/database/PermissionsManager.java
+++ b/src/main/java/org/traccar/database/PermissionsManager.java
@@ -264,45 +264,23 @@ public class PermissionsManager {
return user != null && user.getReadonly();
}
- public boolean getUserDeviceReadonly(long userId) {
- User user = getUser(userId);
- return user != null && user.getDeviceReadonly();
- }
-
public boolean getUserLimitCommands(long userId) {
User user = getUser(userId);
return user != null && user.getLimitCommands();
}
- public boolean getUserDisableReport(long userId) {
- User user = getUser(userId);
- return user != null && user.getDisableReports();
- }
-
public void checkReadonly(long userId) throws SecurityException {
if (!getUserAdmin(userId) && (server.getReadonly() || getUserReadonly(userId))) {
throw new SecurityException("Account is readonly");
}
}
- public void checkDeviceReadonly(long userId) throws SecurityException {
- if (!getUserAdmin(userId) && (server.getDeviceReadonly() || getUserDeviceReadonly(userId))) {
- throw new SecurityException("Account is device readonly");
- }
- }
-
public void checkLimitCommands(long userId) throws SecurityException {
if (!getUserAdmin(userId) && (server.getLimitCommands() || getUserLimitCommands(userId))) {
throw new SecurityException("Account has limit sending commands");
}
}
- public void checkDisableReports(long userId) throws SecurityException {
- if (!getUserAdmin(userId) && (server.getDisableReports() || getUserDisableReport(userId))) {
- throw new SecurityException("Account has reports disabled");
- }
- }
-
public void checkUserDeviceCommand(long userId, long deviceId, long commandId) throws SecurityException {
if (!getUserAdmin(userId) && Context.getCommandsManager().checkDeviceCommand(deviceId, commandId)) {
throw new SecurityException("Command can not be sent to this device");