aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/security
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-03-27 09:52:16 -0700
committerAnton Tananaev <anton@traccar.org>2023-03-27 09:52:16 -0700
commit56c6fd3cfa7140d899ff8e964754e856a8c8b0d8 (patch)
tree3007a70031bb0bfdfa921a660534826402c2b02a /src/main/java/org/traccar/api/security
parent7aa7d2d98e2fd7fb36c50711bf6e547c829d6d58 (diff)
downloadtrackermap-server-56c6fd3cfa7140d899ff8e964754e856a8c8b0d8.tar.gz
trackermap-server-56c6fd3cfa7140d899ff8e964754e856a8c8b0d8.tar.bz2
trackermap-server-56c6fd3cfa7140d899ff8e964754e856a8c8b0d8.zip
Check disabled users
Diffstat (limited to 'src/main/java/org/traccar/api/security')
-rw-r--r--src/main/java/org/traccar/api/security/SecurityRequestFilter.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java
index 9992d49e7..e6641548a 100644
--- a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java
+++ b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java
@@ -15,6 +15,7 @@
*/
package org.traccar.api.security;
+import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.api.resource.SessionResource;
@@ -63,6 +64,9 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
@Inject
private StatisticsManager statisticsManager;
+ @Inject
+ private Injector injector;
+
@Override
public void filter(ContainerRequestContext requestContext) {
@@ -97,13 +101,14 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
Long userId = (Long) request.getSession().getAttribute(SessionResource.USER_ID_KEY);
if (userId != null) {
+ injector.getInstance(PermissionsService.class).getUser(userId).checkDisabled();
statisticsManager.registerRequest(userId);
securityContext = new UserSecurityContext(new UserPrincipal(userId));
}
}
- } catch (SecurityException e) {
+ } catch (SecurityException | StorageException e) {
LOGGER.warn("Authentication error", e);
}