Class AllowDenyMatcherUtil


  • public class AllowDenyMatcherUtil
    extends Object
    Utilities for matching allow / deny String[] pattern collections.
    • Constructor Detail

      • AllowDenyMatcherUtil

        public AllowDenyMatcherUtil()
    • Method Detail

      • joinPatternsIntoAnyMatcher

        @Nullable
        public static Pattern joinPatternsIntoAnyMatcher​(@Nullable
                                                         String[] patterns)
        Makes a pattern that matches whenever one of the patterns matches the input. If no patterns are given, we return null.
      • matchesAny

        public static boolean matchesAny​(String value,
                                         String[] patterns)
      • matchesAny

        public static boolean matchesAny​(String value,
                                         List<String> patterns)
      • userAndGroupsOfUser

        public static List<String> userAndGroupsOfUser​(org.apache.sling.api.SlingHttpServletRequest request)
                                                throws javax.jcr.RepositoryException
        Collects the username and all groups the user belongs to (either explicitly or inherited).
        Throws:
        javax.jcr.RepositoryException