org.jboss.portal.cms.impl.jcr.command
Class ACLEnforcer

java.lang.Object
  extended by org.jboss.portal.cms.impl.jcr.command.ACLEnforcer

public class ACLEnforcer
extends java.lang.Object

ACLEnforcer checks proper access privileges for actions before the Command objects are allowed to execute and do their job on the CMS

Author:
Sohil Shah - sohil.shah@jboss.com - Nov 28, 2006

Nested Class Summary
static class ACLEnforcer.Type
           
 
Constructor Summary
ACLEnforcer(AuthorizationManager authorizationManager)
           
 
Method Summary
protected  void addACLCommand(ACLEnforcer.Type type, java.lang.String commandClassName)
          Add a command to check for security control
protected  boolean computeAccess(User user, java.lang.String path, java.lang.String action)
           
 boolean hasAccess(PortalCMSSecurityContext cmsSecurityContext)
           
protected  boolean hasManageAccess(User user, JCRCommand command)
           
protected  boolean hasReadAccess(User user, JCRCommand command)
           
protected  boolean hasReadAccess(User user, java.lang.String path)
           
protected  boolean hasWriteAccess(User user, JCRCommand command)
           
protected  boolean hasWriteAccess(User user, java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACLEnforcer

public ACLEnforcer(AuthorizationManager authorizationManager)
Method Detail

addACLCommand

protected void addACLCommand(ACLEnforcer.Type type,
                             java.lang.String commandClassName)
Add a command to check for security control

Parameters:
commandClassName - The fully qualified name of the command

hasAccess

public boolean hasAccess(PortalCMSSecurityContext cmsSecurityContext)
Parameters:
securityContext -
Returns:

hasReadAccess

protected boolean hasReadAccess(User user,
                                JCRCommand command)
Parameters:
user -
command -
Returns:

hasReadAccess

protected boolean hasReadAccess(User user,
                                java.lang.String path)
Parameters:
user -
path -
Returns:

hasWriteAccess

protected boolean hasWriteAccess(User user,
                                 JCRCommand command)
Parameters:
user -
command -
Returns:

hasWriteAccess

protected boolean hasWriteAccess(User user,
                                 java.lang.String path)
Parameters:
user -
path -
Returns:

hasManageAccess

protected boolean hasManageAccess(User user,
                                  JCRCommand command)
Parameters:
user -
command -
Returns:

computeAccess

protected boolean computeAccess(User user,
                                java.lang.String path,
                                java.lang.String action)