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.SlingHttpServletRequest.class)
public class Ace
extends AccessFormPage
The ace page options.
-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.apache.sling.jcr.jackrabbit.accessmanager.GetAce
org.apache.sling.jcr.jackrabbit.accessmanager.GetAcl
protected static final String
protected Map<javax.jcr.security.Privilege,
PrivilegeItem> protected String
protected static final Pattern
protected static final Pattern
protected List<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider>
Fields inherited from class org.apache.sling.starter.access.models.AccessFormPage
privilegesInfo, request, resource, response
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
fieldValuesFromReqParams
(org.apache.sling.api.request.RequestParameter[] paramValues) protected String
getFieldValuesForPattern
(Pattern keyPattern) Gets the values of the specified field from the request.boolean
protected Map<javax.jcr.security.Privilege,
PrivilegeItem> Returns a structure with the aggregate privilege relationships that can be used on the client side UI.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 existSet<org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition>
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.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 requestprotected 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 laterMethods inherited from class org.apache.sling.starter.access.models.AccessFormPage
getCanModifyAccessControl, getCanReadAccessControl, getLocation, getPrivilegesInfo
-
Field Details
-
PATH_REPOSITORY
- See Also:
-
RESTRICTION_PATTERN
-
RESTRICTION_PATTERN_DELETE
-
privilegesPriority
-
principalId
-
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
-
init
Instantiates the model.- Overrides:
init
in classAccessFormPage
- Throws:
IOException
-
getPrincipalId
-
getIsInvalidPrincipal
public boolean getIsInvalidPrincipal() throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
getAcePath
-
isExists
public boolean isExists() -
getPrivileges
- 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 itemsdenyMap
- map of denied privileges to the list of restriction itemssrMap
- 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 itemssupportedRestrictions
- 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 sessionresourcePath
- 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
-
getPrivilegeAggregationsAsJSON
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
- Throws:
javax.jcr.RepositoryException
-
getOrderValue
-
getOrderList
- Throws:
javax.jcr.RepositoryException
-
fieldValuesFromReqParams
protected String[] fieldValuesFromReqParams(org.apache.sling.api.request.RequestParameter[] paramValues) -
getFieldValuesForPattern
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
-