Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acegisecurity.taglibs.velocity
Class AuthzImpl  view AuthzImpl download AuthzImpl.java

java.lang.Object
  extended byorg.acegisecurity.taglibs.velocity.AuthzImpl
All Implemented Interfaces:
Authz

public class AuthzImpl
extends java.lang.Object
implements Authz

I decided to wrap several JSP tag in one class, so I have to using inner class to wrap these JSP tag. To using this class, you need to inject Spring Context via SetAppCtx() method. AclTag need Spring Context to get AclManger bean.


Nested Class Summary
private  class AuthzImpl.MyAclTag
          AclTag need to access the application context via the WebApplicationContextUtils and locate an org.acegisecurity.acl.AclManager.
private  class AuthzImpl.MyAuthenticationTag
          it must output somthing to JSP page, so have to override the writeMessage method to avoid JSP related operation.
 
Field Summary
(package private) static int ALL_GRANTED
           
(package private) static int ANY_GRANTED
           
private  org.springframework.context.ApplicationContext appCtx
           
(package private) static int NONE_GRANTED
           
 
Constructor Summary
AuthzImpl()
           
 
Method Summary
 boolean allGranted(java.lang.String roles)
          all the listed roles must be granted to return true, otherwise fasle;
 boolean anyGranted(java.lang.String roles)
          any the listed roles must be granted to return true, otherwise fasle;
 org.springframework.context.ApplicationContext getAppCtx()
          set Spring application context which contains acegi related bean
 java.lang.String getPrincipal()
          implementation of AuthenticationTag
 boolean hasPermission(java.lang.Object domainObject, java.lang.String permissions)
          implementation of AclTag
private  boolean ifGranted(java.lang.String roles, int grantType)
          implementation of AuthorizeTag
 boolean noneGranted(java.lang.String roles)
          none the listed roles must be granted to return true, otherwise fasle;
 void setAppCtx(org.springframework.context.ApplicationContext appCtx)
          test case can use this class to mock application context with aclManager bean in it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_GRANTED

static final int ALL_GRANTED
See Also:
Constant Field Values

ANY_GRANTED

static final int ANY_GRANTED
See Also:
Constant Field Values

NONE_GRANTED

static final int NONE_GRANTED
See Also:
Constant Field Values

appCtx

private org.springframework.context.ApplicationContext appCtx
Constructor Detail

AuthzImpl

public AuthzImpl()
Method Detail

allGranted

public boolean allGranted(java.lang.String roles)
Description copied from interface: Authz
all the listed roles must be granted to return true, otherwise fasle;

Specified by:
allGranted in interface Authz

anyGranted

public boolean anyGranted(java.lang.String roles)
Description copied from interface: Authz
any the listed roles must be granted to return true, otherwise fasle;

Specified by:
anyGranted in interface Authz

getAppCtx

public org.springframework.context.ApplicationContext getAppCtx()
Description copied from interface: Authz
set Spring application context which contains acegi related bean

Specified by:
getAppCtx in interface Authz

getPrincipal

public java.lang.String getPrincipal()
implementation of AuthenticationTag

Specified by:
getPrincipal in interface Authz

hasPermission

public boolean hasPermission(java.lang.Object domainObject,
                             java.lang.String permissions)
implementation of AclTag

Specified by:
hasPermission in interface Authz

ifGranted

private boolean ifGranted(java.lang.String roles,
                          int grantType)
implementation of AuthorizeTag


noneGranted

public boolean noneGranted(java.lang.String roles)
Description copied from interface: Authz
none the listed roles must be granted to return true, otherwise fasle;

Specified by:
noneGranted in interface Authz

setAppCtx

public void setAppCtx(org.springframework.context.ApplicationContext appCtx)
test case can use this class to mock application context with aclManager bean in it.

Specified by:
setAppCtx in interface Authz