Spring Security Framework

org.springframework.security.taglibs.velocity
Class AuthzImpl

java.lang.Object
  extended by org.springframework.security.taglibs.velocity.AuthzImpl
All Implemented Interfaces:
Authz

public class AuthzImpl
extends 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.


Constructor Summary
AuthzImpl()
           
 
Method Summary
 boolean allGranted(String roles)
          all the listed roles must be granted to return true, otherwise fasle;
 boolean anyGranted(String roles)
          any the listed roles must be granted to return true, otherwise fasle;
 ApplicationContext getAppCtx()
          set Spring application context which contains acegi related bean
 String getPrincipal()
          implementation of AuthenticationTag
 boolean hasPermission(Object domainObject, String permissions)
          implementation of AclTag
 boolean noneGranted(String roles)
          none the listed roles must be granted to return true, otherwise fasle;
 void setAppCtx(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
 

Constructor Detail

AuthzImpl

public AuthzImpl()
Method Detail

allGranted

public boolean allGranted(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
Parameters:
roles - - comma separate GrantedAuthoritys
Returns:
granted (true|false)

anyGranted

public boolean anyGranted(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
Parameters:
roles - - comma separate GrantedAuthoritys
Returns:
granted (true|false)

getAppCtx

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

Specified by:
getAppCtx in interface Authz
Returns:
DOCUMENT ME!

getPrincipal

public String getPrincipal()
implementation of AuthenticationTag

Specified by:
getPrincipal in interface Authz
Returns:
DOCUMENT ME!
Throws:
IllegalArgumentException - DOCUMENT ME!

hasPermission

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

Specified by:
hasPermission in interface Authz
Parameters:
domainObject - DOCUMENT ME!
permissions - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IllegalArgumentException - DOCUMENT ME!

noneGranted

public boolean noneGranted(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
Parameters:
roles - - comma separate GrantedAuthoritys
Returns:
granted (true|false)

setAppCtx

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

Specified by:
setAppCtx in interface Authz
Parameters:
appCtx - DOCUMENT ME!

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.