@Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class) public class Ace extends AccessFormPage
The ace page options.
  • Field Details

    • PATH_REPOSITORY

      protected static final String PATH_REPOSITORY
      See Also:
    • RESTRICTION_PATTERN

      protected static final Pattern RESTRICTION_PATTERN
    • RESTRICTION_PATTERN_DELETE

      protected static final Pattern RESTRICTION_PATTERN_DELETE
    • privilegesPriority

      protected static final Map<String,Integer> privilegesPriority
    • principalId

      protected String principalId
    • persistedPrivilegesMap

      protected Map<javax.jcr.security.Privilege,PrivilegeItem> persistedPrivilegesMap
    • restrictionProviders

      protected List<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider> restrictionProviders
    • getAce

      public org.apache.sling.jcr.jackrabbit.accessmanager.GetAce getAce
    • getAcl

      public org.apache.sling.jcr.jackrabbit.accessmanager.GetAcl getAcl
  • Constructor Details

    • Ace

      public Ace()
  • Method Details

    • createPrivilegesPriorityMap

      protected static Map<String,Integer> createPrivilegesPriorityMap()
    • init

      @PostConstruct protected void init() throws IOException
      Instantiates the model.
      Overrides:
      init in class AccessFormPage
      Throws:
      IOException
    • getPrincipalId

      public String getPrincipalId()
    • getIsInvalidPrincipal

      public boolean getIsInvalidPrincipal() throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • getAcePath

      protected String getAcePath()
    • isExists

      public boolean isExists()
    • getPrivileges

      public Collection<PrivilegeItem> getPrivileges() throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • populateEntriesFromPreviousFailedPost

      protected Map<String,String[]> populateEntriesFromPreviousFailedPost(Map<String,List<RestrictionItem>> allowMap, Map<String,List<RestrictionItem>> denyMap, Map<String,org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> srMap)
      Populate the restriction item list from data from a previously failed POST request
      Parameters:
      allowMap - map of allowed privileges to the list of restriction items
      denyMap - map of denied privileges to the list of restriction items
      srMap - map where the key is the restriction name and the value is the restriction definition
      Returns:
      map of field values that were found in the form context
    • populateEntriesForMissingMandatoryRestrictions

      protected void populateEntriesForMissingMandatoryRestrictions(List<RestrictionItem> list, Set<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> supportedRestrictions)
      Populate restriction item entries for any restriction definitions that are mandatory and not already declared.
      Parameters:
      list - the list of restriction items
      supportedRestrictions - supported restrictions set
    • toSrMap

      protected Map<String,org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> toSrMap(Set<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> supportedRestrictions)
      Convert the supported restrictions to a map for quick lookup later
      Parameters:
      supportedRestrictions - the supported restrictions
      Returns:
      a map where the key is the restriction name and the value is the restriction definition
    • getSupportedOrRegisteredPrivileges

      @NotNull protected @NotNull javax.jcr.security.Privilege[] getSupportedOrRegisteredPrivileges(@NotNull @NotNull javax.jcr.Session jcrSession, @Nullable @Nullable String resourcePath) throws javax.jcr.RepositoryException
      Calculates the supported privileges in the resource path exists, or the registered privileges if the resource path does not exist
      Parameters:
      jcrSession - the current session
      resourcePath - the resource path to consider
      Returns:
      Throws:
      javax.jcr.RepositoryException
    • initialPrivilegesMap

      protected Map<javax.jcr.security.Privilege,PrivilegeItem> initialPrivilegesMap(Map<javax.jcr.security.Privilege,String> privilegeToLongestPath, String acePath)
    • getPersistedPrivilegesMap

      protected Map<javax.jcr.security.Privilege,PrivilegeItem> getPersistedPrivilegesMap() throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • jsonToRestrictionItems

      protected List<RestrictionItem> jsonToRestrictionItems(Map<String,org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> srMap, jakarta.json.JsonObject restrictionsObj)
    • getSupportedRestrictions

      public Set<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> getSupportedRestrictions()
    • getSupportedRestrictionsInfo

      public List<RestrictionDefinitionInfo> getSupportedRestrictionsInfo()
    • getPrivilegeAggregationsAsJSON

      public String getPrivilegeAggregationsAsJSON() throws javax.jcr.RepositoryException
      Returns a structure with the aggregate privilege relationships that can be used on the client side UI.
      Returns:
      JSON representation of the privilege aggregations
      Throws:
      javax.jcr.RepositoryException
    • getExistingRestrictionNamesAsJSON

      public String getExistingRestrictionNamesAsJSON() throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • getOrderValue

      public String getOrderValue()
    • getOrderList

      public Collection<PrincipalPrivilege> getOrderList() throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • fieldValuesFromReqParams

      protected String[] fieldValuesFromReqParams(org.apache.sling.api.request.RequestParameter[] paramValues)
    • getFieldValuesForPattern

      protected Map<String,String[]> getFieldValuesForPattern(Pattern keyPattern)
      Gets the values of the specified field from the request. If not supplied the values from the supplied resource are returned.
      Parameters:
      keyPattern - the regular expression to used to match against the field keys
      Returns:
      the values of the field or empty map if not available