aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/BaseResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-02-21 17:33:58 -0800
committerAnton Tananaev <anton@traccar.org>2022-04-05 15:48:51 -0700
commit9ec2d09ad8a757d58f70812b9cf5e835321382e6 (patch)
tree3632335375c62d7e30d32c49b9d952af3eb0b748 /src/main/java/org/traccar/api/BaseResource.java
parent307c4dd690c5826e076657fa83f2ddd41cec1126 (diff)
downloadtrackermap-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/api/BaseResource.java')
-rw-r--r--src/main/java/org/traccar/api/BaseResource.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/BaseResource.java b/src/main/java/org/traccar/api/BaseResource.java
index 6dff8c8c3..33abe73fa 100644
--- a/src/main/java/org/traccar/api/BaseResource.java
+++ b/src/main/java/org/traccar/api/BaseResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,11 @@
*/
package org.traccar.api;
+import org.traccar.api.security.PermissionsService;
import org.traccar.api.security.UserPrincipal;
+import org.traccar.storage.Storage;
+import javax.inject.Inject;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.SecurityContext;
@@ -25,6 +28,12 @@ public class BaseResource {
@Context
private SecurityContext securityContext;
+ @Inject
+ protected Storage storage;
+
+ @Inject
+ protected PermissionsService permissionsService;
+
protected long getUserId() {
UserPrincipal principal = (UserPrincipal) securityContext.getUserPrincipal();
if (principal != null) {
@@ -32,4 +41,5 @@ public class BaseResource {
}
return 0;
}
+
}