Package org.apache.sling.jcr.jackrabbit.accessmanager.post

# Class DeletePrincipalAcesServlet

java.lang.Object
jakarta.servlet.GenericServlet
org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet
org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessPostServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.DeleteAcesServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.DeletePrincipalAcesServlet

All Implemented Interfaces:
  `jakarta.servlet.Servlet`, `jakarta.servlet.ServletConfig`, `Serializable`, `DeleteAces`, `DeletePrincipalAces`

public class DeletePrincipalAcesServlet extends DeleteAcesServlet implements DeletePrincipalAces

Sling Post Servlet implementation for deleting the principal ACE for a set of principals on a JCR resource.

## Rest Service Description

Delete a set of Ace's from a node, the node is identified as a resource by the request url >resource<.deletePAce.html

### Transport Details:

#### Methods

- POST

#### Post Parameters

:applyTo
  An array of ace principal names to delete. Note the principal name is the primary key of the Ace in the Acl

#### Response

200
  Success.
404
  The resource was not found.
500
  Failure. HTML explains the failure.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`DeletePrincipalAcesServlet()`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`allowNonExistingPaths()`
Returns whether this operation can operate on paths that do not exist yet
`protected void`
`deleteAces(javax.jcr.Session jcrSession, String resourcePath, String[] principalNamesToDelete, List<org.apache.sling.servlets.post.Modification> changes)`
`void`
`deletePrincipalAces(javax.jcr.Session jcrSession, String resourcePath, String[] principalNamesToDelete)`
Deletes one or more pricipal ACEs from the access control list of a resource.
`protected org.apache.jackrabbit.api.security.authorization.PrincipalAccessControlList`
`getAccessControlListOrNull(org.apache.jackrabbit.api.security.JackrabbitAccessControlManager jacm, Principal principal)`

### Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.DeleteAcesServlet

`deleteAces, handleOperation, validateArgs`

### Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessPostServlet

`bindPostResponseCreator, doPost, externalizePath, getAccessControlList, getAccessControlListOrNull, getItemPath, getParentPath, getRedirectUrl, isSetStatus, unbindPostResponseCreator, validateResourcePath`

### Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessServlet

`bindRestrictionProvider, getRestrictionProvider, unbindRestrictionProvider`

### Methods inherited from class org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet

`doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService`

### Methods inherited from class org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet

`doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service`

### Methods inherited from class jakarta.servlet.GenericServlet

`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log`

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

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

## Constructor Details

### DeletePrincipalAcesServlet

public DeletePrincipalAcesServlet()

## Method Details

### allowNonExistingPaths

protected boolean allowNonExistingPaths()
Description copied from class: `AbstractAccessPostServlet`
Returns whether this operation can operate on paths that do not exist yet

Overrides:
  `allowNonExistingPaths` in class `AbstractAccessPostServlet`
Returns:
  true if the resourcePath must exist, false otherwise

### deletePrincipalAces

public void deletePrincipalAces(javax.jcr.Session jcrSession, String resourcePath, String[] principalNamesToDelete) throws javax.jcr.RepositoryException
Description copied from interface: `DeletePrincipalAces`
Deletes one or more pricipal ACEs from the access control list of a resource.

Specified by:
  `deletePrincipalAces` in interface `DeletePrincipalAces`
Parameters:
  `jcrSession` - the JCR session of the user updating the user
  `resourcePath` - The path of the resource to update the ACL for (required)
  `principalNamesToDelete` - An array of ace principal names to delete.. (required)
Throws:
  `javax.jcr.RepositoryException` - if any errors applying the changes

### deleteAces

protected void deleteAces(javax.jcr.Session jcrSession, String resourcePath, String[] principalNamesToDelete, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException

Overrides:
  `deleteAces` in class `DeleteAcesServlet`
Throws:
  `javax.jcr.RepositoryException`

### getAccessControlListOrNull

protected org.apache.jackrabbit.api.security.authorization.PrincipalAccessControlList getAccessControlListOrNull(org.apache.jackrabbit.api.security.JackrabbitAccessControlManager jacm, Principal principal) throws javax.jcr.RepositoryException

Throws:
  `javax.jcr.RepositoryException`