Package org.apache.sling.starter.access.models

# Class Ace

java.lang.Object
org.apache.sling.starter.access.models.AccessFormPage
org.apache.sling.starter.access.models.Ace

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

## Field Summary

Fields
Modifier and Type
Field
Description
`org.apache.sling.jcr.jackrabbit.accessmanager.GetAce`
`getAce`
`org.apache.sling.jcr.jackrabbit.accessmanager.GetAcl`
`getAcl`
`protected static final String`
`PATH_REPOSITORY`
`protected Map<javax.jcr.security.Privilege,PrivilegeItem>`
`persistedPrivilegesMap`
`protected String`
`principalId`
`protected static final Map<String,Integer>`
`privilegesPriority`
`protected static final Pattern`
`RESTRICTION_PATTERN`
`protected static final Pattern`
`RESTRICTION_PATTERN_DELETE`
`protected List<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider>`
`restrictionProviders`

### Fields inherited from class org.apache.sling.starter.access.models.AccessFormPage

`privilegesInfo, request, resource, response`

## Constructor Summary

Constructors
Constructor
Description
`Ace()`

## Method Summary

Modifier and Type
Method
Description
`protected static Map<String,Integer>`
`createPrivilegesPriorityMap()`
`protected String[]`
`fieldValuesFromReqParams(org.apache.sling.api.request.RequestParameter[] paramValues)`
`protected String`
`getAcePath()`
`String`
`getExistingRestrictionNamesAsJSON()`
`protected Map<String,String[]>`
`getFieldValuesForPattern(Pattern keyPattern)`
Gets the values of the specified field from the request.
`boolean`
`getIsInvalidPrincipal()`
`Collection<PrincipalPrivilege>`
`getOrderList()`
`String`
`getOrderValue()`
`protected Map<javax.jcr.security.Privilege,PrivilegeItem>`
`getPersistedPrivilegesMap()`
`String`
`getPrincipalId()`
`String`
`getPrivilegeAggregationsAsJSON()`
Returns a structure with the aggregate privilege relationships that can be used on the client side UI.
`Collection<PrivilegeItem>`
`getPrivileges()`
`protected @NotNull javax.jcr.security.Privilege[]`
`getSupportedOrRegisteredPrivileges(@NotNull javax.jcr.Session jcrSession, @Nullable String resourcePath)`
Calculates the supported privileges in the resource path exists, or the registered privileges if the resource path does not exist
`Set<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition>`
`getSupportedRestrictions()`
`List<RestrictionDefinitionInfo>`
`getSupportedRestrictionsInfo()`
`protected void`
`init()`
Instantiates the model.
`protected Map<javax.jcr.security.Privilege,PrivilegeItem>`
`initialPrivilegesMap(Map<javax.jcr.security.Privilege,String> privilegeToLongestPath, String acePath)`
`boolean`
`isExists()`
`protected List<RestrictionItem>`
`jsonToRestrictionItems(Map<String,org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> srMap, jakarta.json.JsonObject restrictionsObj)`
`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.
`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
`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

### Methods inherited from class org.apache.sling.starter.access.models.AccessFormPage

`getCanModifyAccessControl, getCanReadAccessControl, getLocation, getPrivilegesInfo`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PATH_REPOSITORY

protected static final String PATH_REPOSITORY

See Also:
  - Constant Field Values

### 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