|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
ch.security4web.esapi.authentication.EsapiAuthorization
public class EsapiAuthorization
The EsapiAuthorized class stores the users information in the user.txt file, that information contains user's role, user's last login time, etc. and based on the information, the users are given the rights to access the presentation layer of the JSF application. The presentation layer is nothing but .XHTML or JSP file
For example :-
<esapi:authorization role="admin">
Admin Content.
<esapi:authorization>
For example :-
<esapi:authorization role="user">
User Content.
</esapi:authorization>
The User with "user" role could see only data, which is inside the tag but other important data with other roles are not visualized to them.
Field Summary |
---|
Fields inherited from class javax.faces.component.UIOutput |
---|
COMPONENT_FAMILY, COMPONENT_TYPE |
Constructor Summary | |
---|---|
EsapiAuthorization()
constructor. |
Method Summary | |
---|---|
void |
encodeBegin(javax.faces.context.FacesContext context)
This method render component and sub component inside authorization tag base of user authorization. |
java.lang.String |
getFamily()
Give family of this tag |
java.lang.String |
getRole()
Get role associated with authorization tag. |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
Restore value of role in existing facelet context |
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
Save state of role associated with authorization tag in facelest context. |
void |
setRole(java.lang.String role)
Role is set which is associated with authorization tag. "admin","user" ext. |
Methods inherited from class javax.faces.component.UIOutput |
---|
getConverter, getLocalValue, getValue, setConverter, setValue |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EsapiAuthorization()
Method Detail |
---|
public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UIOutput
context
- facelet Context
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIOutput
context
- facelet contextstate
- state of role to be restored in existing context.public java.lang.String getFamily()
getFamily
in class javax.faces.component.UIOutput
public java.lang.String getRole()
public void setRole(java.lang.String role)
"admin","user" ext.
role
- role namepublic void encodeBegin(javax.faces.context.FacesContext context) throws java.io.IOException
role="admin"
could see all page content.
role="user"
could visualized only public content on the page and "user"
.
but not able to see "admin"
content.
encodeBegin
in class javax.faces.component.UIComponentBase
context
- facelet context
java.io.IOException
- throws IOException when user is not found inside user.txt file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |