Class DeleteAuthorizableServlet

All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, DeleteAuthorizables, DeleteGroup, DeleteUser

public class DeleteAuthorizableServlet extends AbstractPostServlet implements DeleteUser, DeleteGroup, DeleteAuthorizables

Rest Service Description

Deletes an Authorizable, currently a user or a group. Maps on to nodes of resourceType sling/users or sling/users like /rep:system/rep:userManager/rep:users or /rep:system/rep:userManager/rep:groups mapped to a resource url /system/userManager/user or /system/userManager/group. This servlet responds at /system/userManager/user.delete.html or /system/userManager/group.delete.html. The servlet also responds to single delete requests eg /system/userManager/group/newGroup.delete.html

Methods

  • POST

Post Parameters

:applyTo
An array of relative resource references to Authorizables to be deleted, if this parameter is present, the url is ignored and all the Authorizables in the list are removed.

Response

200
Success, no body.
404
The resource was not found
500
Failure

Example

curl -Fgo=1 http://localhost:8080/system/userManager/user/ieb.delete.html
See Also:
  • Constructor Details

    • DeleteAuthorizableServlet

      public DeleteAuthorizableServlet()
  • Method Details

    • bindPostResponseCreator

      protected void bindPostResponseCreator(PostResponseCreator creator, Map<String,Object> properties)
      Overridden since the @Reference annotation is not inherited from the super method
      Overrides:
      bindPostResponseCreator in class AbstractPostServlet
      See Also:
    • unbindPostResponseCreator

      protected void unbindPostResponseCreator(PostResponseCreator creator, Map<String,Object> properties)
      Description copied from class: AbstractPostServlet
      Unbind a post response creator
      Overrides:
      unbindPostResponseCreator in class AbstractPostServlet
    • handleOperation

      protected void handleOperation(SlingHttpServletRequest request, PostResponse response, List<Modification> changes) throws javax.jcr.RepositoryException
      Description copied from class: AbstractPostServlet
      Extending Servlet should implement this operation to do the work
      Specified by:
      handleOperation in class AbstractPostServlet
      Parameters:
      request - the sling http request to process
      response - the response
      changes - the changes to report
      Throws:
      javax.jcr.RepositoryException - in case of exceptions during the operation
    • deleteUser

      public void deleteUser(javax.jcr.Session jcrSession, String name, List<Modification> changes) throws javax.jcr.RepositoryException
      Description copied from interface: DeleteUser
      Deletes a user from the repository
      Specified by:
      deleteUser in interface DeleteUser
      Parameters:
      jcrSession - the JCR session of the user creating the user
      name - The name of the user to delete (required)
      changes - The list of changes for this operation (optional)
      Throws:
      javax.jcr.RepositoryException - if user can't be deleted
    • deleteGroup

      public void deleteGroup(javax.jcr.Session jcrSession, String name, List<Modification> changes) throws javax.jcr.RepositoryException
      Description copied from interface: DeleteGroup
      Deletes a group from the repository
      Specified by:
      deleteGroup in interface DeleteGroup
      Parameters:
      jcrSession - the JCR session of the user creating the user
      name - The name of the group to delete (required)
      changes - The list of changes for this operation (optional)
      Throws:
      javax.jcr.RepositoryException - if group can't be deleted
    • deleteAuthorizables

      public void deleteAuthorizables(javax.jcr.Session jcrSession, Resource baseResource, String[] paths, List<Modification> changes) throws javax.jcr.RepositoryException
      Description copied from interface: DeleteAuthorizables
      Deletes one or more users or groups from the repository
      Specified by:
      deleteAuthorizables in interface DeleteAuthorizables
      Parameters:
      jcrSession - the JCR session of the user creating the user
      baseResource - the base resource to calculate the relative paths from (required)
      paths - An array of relative resource paths to Authorizables to be deleted (required)
      changes - The list of changes for this operation (optional)
      Throws:
      javax.jcr.RepositoryException - if authorizable (user or group) can't be deleted