Class FaceletsTagUtils


  • public final class FaceletsTagUtils
    extends java.lang.Object
    This class provides static methods that are registered as EL functions and available for use in Unified EL expressions in standard Facelets views.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FaceletsTagUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean areAllGranted​(java.lang.String authorities)
      Returns true if the user has all of of the given authorities.
      static boolean areAnyGranted​(java.lang.String authorities)
      Returns true if the user has any of the given authorities.
      static boolean areNotGranted​(java.lang.String authorities)
      Returns true if the user does not have any of the given authorities.
      static boolean isAllowed​(java.lang.String url, java.lang.String method)
      Returns true if the user is allowed to access the given URL and HTTP method combination.
      static boolean isAnonymous()
      Returns true if user is anonymous.
      static boolean isAuthenticated()
      Returns true if the user is not anonymous.
      static boolean isFullyAuthenticated()
      Returns true if the is not an anonymous or a remember-me user.
      • Methods inherited from class java.lang.Object

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

      • FaceletsTagUtils

        protected FaceletsTagUtils()
    • Method Detail

      • areAllGranted

        public static boolean areAllGranted​(java.lang.String authorities)
                                     throws java.io.IOException
        Returns true if the user has all of of the given authorities.
        Parameters:
        authorities - a comma-separated list of user authorities.
        Returns:
        computation if the user has all of of the given authorities
        Throws:
        java.io.IOException - io exception
      • areAnyGranted

        public static boolean areAnyGranted​(java.lang.String authorities)
                                     throws java.io.IOException
        Returns true if the user has any of the given authorities.
        Parameters:
        authorities - a comma-separated list of user authorities.
        Returns:
        computation if the user has any of the given authorities.
        Throws:
        java.io.IOException - io exception
      • areNotGranted

        public static boolean areNotGranted​(java.lang.String authorities)
                                     throws java.io.IOException
        Returns true if the user does not have any of the given authorities.
        Parameters:
        authorities - a comma-separated list of user authorities.
        Returns:
        computation if the user does not have any of the given authorities.
        Throws:
        java.io.IOException - io exception
      • isAllowed

        public static boolean isAllowed​(java.lang.String url,
                                        java.lang.String method)
                                 throws java.io.IOException
        Returns true if the user is allowed to access the given URL and HTTP method combination. The HTTP method is optional and case insensitive.
        Parameters:
        url - to be accessed.
        method - to be called.
        Returns:
        computation if the user is allowed to access the given URL and HTTP method.
        Throws:
        java.io.IOException - io exception
      • isAnonymous

        public static boolean isAnonymous()
                                   throws java.io.IOException
        Returns true if user is anonymous.
        Returns:
        computation if the user is anonymous.
        Throws:
        java.io.IOException - io exception
      • isAuthenticated

        public static boolean isAuthenticated()
                                       throws java.io.IOException
        Returns true if the user is not anonymous.
        Returns:
        computation if the user is not anonymous.
        Throws:
        java.io.IOException - io exception
      • isFullyAuthenticated

        public static boolean isFullyAuthenticated()
                                            throws java.io.IOException
        Returns true if the is not an anonymous or a remember-me user.
        Returns:
        computation if the user is not an anonymous or a remember-me user.
        Throws:
        java.io.IOException - io exception