aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/security/PermissionsService.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-07-06 17:46:17 -0700
committerAnton Tananaev <anton@traccar.org>2024-07-06 17:46:17 -0700
commitb8390005722dd1cdb24d762797ef3f98ebc37755 (patch)
treecaabf1a7541aebc4e81565e95ee78e2d8afe3d75 /src/main/java/org/traccar/api/security/PermissionsService.java
parent75e3c6a6bbb028b2f99b06faac66d5b53cf59900 (diff)
downloadtrackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.tar.gz
trackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.tar.bz2
trackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.zip
Update instanceof expressions
Diffstat (limited to 'src/main/java/org/traccar/api/security/PermissionsService.java')
-rw-r--r--src/main/java/org/traccar/api/security/PermissionsService.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/api/security/PermissionsService.java b/src/main/java/org/traccar/api/security/PermissionsService.java
index d4a6fba1a..721793c2f 100644
--- a/src/main/java/org/traccar/api/security/PermissionsService.java
+++ b/src/main/java/org/traccar/api/security/PermissionsService.java
@@ -128,8 +128,7 @@ public class PermissionsService {
throws StorageException, SecurityException {
if (!getUser(userId).getAdministrator()) {
checkEdit(userId, object.getClass(), addition, skipReadonly);
- if (object instanceof GroupedModel) {
- GroupedModel after = ((GroupedModel) object);
+ if (object instanceof GroupedModel after) {
if (after.getGroupId() > 0) {
GroupedModel before = null;
if (!addition) {
@@ -141,8 +140,7 @@ public class PermissionsService {
}
}
}
- if (object instanceof Schedulable) {
- Schedulable after = ((Schedulable) object);
+ if (object instanceof Schedulable after) {
if (after.getCalendarId() > 0) {
Schedulable before = null;
if (!addition) {
@@ -154,8 +152,7 @@ public class PermissionsService {
}
}
}
- if (object instanceof Notification) {
- Notification after = ((Notification) object);
+ if (object instanceof Notification after) {
if (after.getCommandId() > 0) {
Notification before = null;
if (!addition) {