Class 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.String currentUser()  
      static boolean isAccessGranted​(java.lang.Class<?> securedClass)  
      static boolean isFrameworkInternalRequest​(javax.servlet.http.HttpServletRequest request)
      Tests if the request is an internal framework request.
      static boolean isSecurityEnabled()  
      static boolean isUserInRole​(java.lang.String role)  
      static boolean isUserLoggedIn()
      Tests if some user is authenticated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SecurityUtils

        public SecurityUtils()
    • 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 an AnonymousAuthenticationToken we have to ignore those tokens explicitly.
      • currentUser

        public static java.lang.String currentUser()
      • isSecurityEnabled

        public static boolean isSecurityEnabled()