code: @Override
    public @NotNull Set<String> getAllowedComponents(@NotNull String resourcePath, @NotNull ResourceResolver resolver) {
      PageManager pageManager = AdaptTo.notNull(resolver, PageManager.class);
      Page page = pageManager.getContainingPage(resourcePath);
      if (page == null && StringUtils.contains(resourcePath, "/" + JcrConstants.JCR_CONTENT)) {
        // if resource does not exist (e.g. inherited parsys) get page from resource path manually
        page = pageManager.getPage(StringUtils.substringBefore(resourcePath, "/" + JcrConstants.JCR_CONTENT));
      }
      if (page == null) {
        return ImmutableSet.of();
      }
      String relativePath = StringUtils.substringAfter(resourcePath, page.getPath() + "/");
      return getAllowedComponents(page, relativePath, null, resolver);
    }
docs: Get allowed components for given resource path
  @param resourcePath Resource path inside content page
  @return Set of component paths (absolute resource types)