com.day.cq.security.impl.authorization
Class AclEditor

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by org.apache.sling.api.servlets.SlingSafeMethodsServlet
          extended by org.apache.sling.api.servlets.SlingAllMethodsServlet
              extended by com.day.cq.security.impl.AbstractHTMLResponseServlet
                  extended by com.day.cq.security.impl.authorization.AclEditor
All Implemented Interfaces:
RequestConstants, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class AclEditor
extends AbstractHTMLResponseServlet

See Also:
Serialized Form

Field Summary
static String PARAM_MODIFIED
          Parameter containing the modified/added ACEs
static String PARAM_PATH
          Parameter of the Path to access the ACL of
static String PARAM_REMOVED
          Parameter containing the removed ACEs
static String VIEW_ACL
          View of the plain ACL
static String VIEW_EFFECTIVE
          View of the effective ACL
 
Fields inherited from interface com.day.cq.security.util.RequestConstants
ENCODING_UTF_8, JSON_CONTENT_TYPE, JSON_EXTENSION, JSON_INFINITY, PARAM_AUTHORIZABLE, PREFIX_CURRENT
 
Constructor Summary
AclEditor()
           
 
Method Summary
protected  PermissionTable getTable(org.apache.sling.api.SlingHttpServletRequest request)
          Access a tabular view of the requests pathe's ACL
protected  void serviceGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.sling.api.servlets.HtmlResponse htmlResponse)
          Exports an ACL in a JSON format suited for an EXT Grid.
protected  void servicePost(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.sling.api.servlets.HtmlResponse htmlResponse)
           
 
Methods inherited from class com.day.cq.security.impl.AbstractHTMLResponseServlet
doGet, doPost
 
Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
 
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_PATH

public static final String PARAM_PATH
Parameter of the Path to access the ACL of

See Also:
Constant Field Values

PARAM_MODIFIED

public static final String PARAM_MODIFIED
Parameter containing the modified/added ACEs

See Also:
Constant Field Values

PARAM_REMOVED

public static final String PARAM_REMOVED
Parameter containing the removed ACEs

See Also:
Constant Field Values

VIEW_ACL

public static final String VIEW_ACL
View of the plain ACL

See Also:
Constant Field Values

VIEW_EFFECTIVE

public static final String VIEW_EFFECTIVE
View of the effective ACL

See Also:
Constant Field Values
Constructor Detail

AclEditor

public AclEditor()
Method Detail

serviceGet

protected void serviceGet(org.apache.sling.api.SlingHttpServletRequest request,
                          org.apache.sling.api.SlingHttpServletResponse response,
                          org.apache.sling.api.servlets.HtmlResponse htmlResponse)
                   throws javax.servlet.ServletException,
                          IOException
Exports an ACL in a JSON format suited for an EXT Grid. Including metadata:
 {
  "acl":[{
      "type":"group",
      "principal":"administrators",
      "add_node":"allow",
      "acl_read":"allow",
      "acl_edit":"allow",
      "set_property":"allow",
      "path": "/conten/en"
      }]}
 

Overrides:
serviceGet in class AbstractHTMLResponseServlet
Parameters:
request - to service
response - response generated
htmlResponse - formater to record request processing
Throws:
javax.servlet.ServletException
IOException

servicePost

protected void servicePost(org.apache.sling.api.SlingHttpServletRequest request,
                           org.apache.sling.api.SlingHttpServletResponse response,
                           org.apache.sling.api.servlets.HtmlResponse htmlResponse)
                    throws javax.servlet.ServletException,
                           IOException
Overrides:
servicePost in class AbstractHTMLResponseServlet
Parameters:
request - to process
response - to send
Throws:
javax.servlet.ServletException - in case of general error
IOException - in case of Json eerror

getTable

protected PermissionTable getTable(org.apache.sling.api.SlingHttpServletRequest request)
                            throws AccessDeniedException,
                                   RepositoryException
Access a tabular view of the requests pathe's ACL

Parameters:
request - for the table
Returns:
the Table
Throws:
AccessDeniedException - in case the requesting User doesn't have the permission to read the ACL information
RepositoryException - in case the Repository can not be accessed


Copyright © 2008 Day Management AG. All Rights Reserved.