Package se.ikama.bauta.security
Class SecurityUtils
- java.lang.Object
-
- se.ikama.bauta.security.SecurityUtils
-
public final class SecurityUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SecurityUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcurrentUser()static booleanisAccessGranted(java.lang.Class<?> securedClass)static booleanisFrameworkInternalRequest(javax.servlet.http.HttpServletRequest request)Tests if the request is an internal framework request.static booleanisSecurityEnabled()static booleanisUserInRole(java.lang.String role)static booleanisUserLoggedIn()Tests if some user is authenticated.
-
-
-
Method Detail
-
isFrameworkInternalRequest
public static boolean isFrameworkInternalRequest(javax.servlet.http.HttpServletRequest request)
Tests if the request is an internal framework request. The test consists of checking if the request parameter is present and if its value is consistent with any of the request types know.- Parameters:
request-HttpServletRequest- Returns:
- true if is an internal framework request. False otherwise.
-
isAccessGranted
public static boolean isAccessGranted(java.lang.Class<?> securedClass)
-
isUserInRole
public static boolean isUserInRole(java.lang.String role)
-
isUserLoggedIn
public static boolean isUserLoggedIn()
Tests if some user is authenticated. As Spring Security always will create anAnonymousAuthenticationTokenwe have to ignore those tokens explicitly.
-
currentUser
public static java.lang.String currentUser()
-
isSecurityEnabled
public static boolean isSecurityEnabled()
-
-