org.alfresco.web.ui.repo.component.evaluator
Class PermissionEvaluator

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.springframework.extensions.webscripts.ui.common.component.SelfRenderingComponent
              extended by org.alfresco.web.ui.common.component.evaluator.BaseEvaluator
                  extended by org.alfresco.web.ui.repo.component.evaluator.PermissionEvaluator
All Implemented Interfaces:
javax.faces.component.StateHolder

public class PermissionEvaluator
extends BaseEvaluator

Evaulator for returning whether a Node is Allowed/Denied a list of permissions


Field Summary
 
Fields inherited from class org.alfresco.web.ui.common.component.evaluator.BaseEvaluator
s_logger
 
Constructor Summary
PermissionEvaluator()
           
 
Method Summary
 boolean evaluate()
          Evaluate against the component attributes.
 java.lang.String getAllow()
          Get the allow permissions to match value against
 java.lang.String getDeny()
          Get the deny permissions to match value against
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAllow(java.lang.String allow)
          Set the allow permissions to match value against
 void setDeny(java.lang.String deny)
          Set the deny permissions to match value against
 
Methods inherited from class org.alfresco.web.ui.common.component.evaluator.BaseEvaluator
encodeBegin, encodeChildren, encodeEnd, getFamily, getRendersChildren, getValue, setValue
 
Methods inherited from class org.springframework.extensions.webscripts.ui.common.component.SelfRenderingComponent
outputAttribute
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionEvaluator

public PermissionEvaluator()
Method Detail

evaluate

public boolean evaluate()
Evaluate against the component attributes. Return true to allow the inner components to render, false to hide them during rendering. IN: Value - either a Node (preferred) or NodeRef to test Allow - Permission(s) (comma separated) to test against Deny - Permission(s) (comma separated) to test against

Specified by:
evaluate in class BaseEvaluator
Returns:
true to allow rendering of child components, false otherwise

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class BaseEvaluator
See Also:
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class BaseEvaluator
See Also:
StateHolder.saveState(javax.faces.context.FacesContext)

getAllow

public java.lang.String getAllow()
Get the allow permissions to match value against

Returns:
the allow permissions to match value against

setAllow

public void setAllow(java.lang.String allow)
Set the allow permissions to match value against

Parameters:
allow - allow permissions to match value against

getDeny

public java.lang.String getDeny()
Get the deny permissions to match value against

Returns:
the deny permissions to match value against

setDeny

public void setDeny(java.lang.String deny)
Set the deny permissions to match value against

Parameters:
deny - deny permissions to match value against


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.