public class BasicGroupAuthz extends java.lang.Object implements IAuthzManager, IExtendedPluginInfo
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[] |
configParams |
protected static java.util.Vector<java.lang.String> |
extendedPluginInfo |
HELP_TEXT, HELP_TOKEN
Constructor and Description |
---|
BasicGroupAuthz() |
Modifier and Type | Method and Description |
---|---|
void |
accessInit(java.lang.String accessInfo)
accessInit is for servlets who want to initialize their
own authorization information before full operation. |
java.util.Enumeration<IAccessEvaluator> |
aclEvaluatorElements()
Get all registered evaluators.
|
AuthzToken |
authorize(IAuthToken authToken,
java.lang.String expression) |
AuthzToken |
authorize(IAuthToken authToken,
java.lang.String resource,
java.lang.String operation)
Check if the user is authorized to perform the given operation on the
given resource.
|
java.util.Hashtable<java.lang.String,IAccessEvaluator> |
getAccessEvaluators()
Return a table of evaluators
|
IACL |
getACL(java.lang.String target)
Get individual ACL entry for the given name of entry.
|
java.util.Enumeration<ACL> |
getACLs()
Get ACL entries
|
java.lang.String[] |
getConfigParams()
Get configuration parameters for this implementation.
|
IConfigStore |
getConfigStore()
Get the configuration store for this authorization manager.
|
java.lang.String[] |
getExtendedPluginInfo(java.util.Locale locale)
This method returns an array of strings.
|
java.lang.String |
getImplName()
Get implementation name of authorization manager plugin.
|
java.lang.String |
getName()
Get the name of this authorization manager instance.
|
void |
init(java.lang.String name,
java.lang.String implName,
IConfigStore config)
Initialize this authorization manager.
|
void |
registerEvaluator(java.lang.String type,
IAccessEvaluator evaluator)
Register new evaluator
|
void |
shutdown()
Prepare this authorization manager for a graceful shutdown.
|
void |
updateACLs(java.lang.String id,
java.lang.String rights,
java.lang.String strACLs,
java.lang.String desc)
Update ACLs in the database
|
protected static java.util.Vector<java.lang.String> extendedPluginInfo
protected static java.lang.String[] configParams
public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
IExtendedPluginInfo
getExtendedPluginInfo
in interface IExtendedPluginInfo
public java.lang.String getName()
IAuthzManager
getName
in interface IAuthzManager
public java.lang.String getImplName()
IAuthzManager
An example of an implementation name will be:
com.netscape.cms.BasicAclAuthz
getImplName
in interface IAuthzManager
public void accessInit(java.lang.String accessInfo) throws EBaseException
IAuthzManager
accessInit
is for servlets who want to initialize their
own authorization information before full operation. It is supposed
to be called from the authzMgrAccessInit() method of the AuthzSubsystem.
The accessInfo format is determined by each individual authzmgr. For example, for BasicAclAuthz, The accessInfo is the resACLs, whose format should conform to the following:
:right-1[,right-n]:[allow,deny](right(s)) = : Example: resTurnKnob:left,right:allow(left) group="lefties":door knobs for lefties
accessInit
in interface IAuthzManager
accessInfo
- the access info string in the format specified in the authorization managerEBaseException
- error parsing the accessInfopublic AuthzToken authorize(IAuthToken authToken, java.lang.String resource, java.lang.String operation) throws EAuthzInternalError, EAuthzAccessDenied
IAuthzManager
authorize
in interface IAuthzManager
authToken
- the authToken associated with a user.resource
- - the protected resource nameoperation
- - the protected resource operation nameEAuthzInternalError
- if an internal error occurred.EAuthzAccessDenied
- if access deniedpublic AuthzToken authorize(IAuthToken authToken, java.lang.String expression) throws EAuthzInternalError, EAuthzAccessDenied
authorize
in interface IAuthzManager
EAuthzInternalError
EAuthzAccessDenied
public void init(java.lang.String name, java.lang.String implName, IConfigStore config) throws EBaseException
IAuthzManager
init
in interface IAuthzManager
name
- The name of this authorization manager instance.implName
- The name of the authorization manager plugin.config
- The configuration store for this authorization manager.EBaseException
- If an initialization error occurred.public void shutdown()
IAuthzManager
shutdown
in interface IAuthzManager
public java.lang.String[] getConfigParams() throws EBaseException
IAuthzManager
getConfigParams
in interface IAuthzManager
EBaseException
- If an internal error occurredpublic IConfigStore getConfigStore()
IAuthzManager
getConfigStore
in interface IAuthzManager
public java.util.Enumeration<ACL> getACLs()
IAuthzManager
getACLs
in interface IAuthzManager
public IACL getACL(java.lang.String target)
IAuthzManager
getACL
in interface IAuthzManager
target
- The name of the ACL entrypublic void updateACLs(java.lang.String id, java.lang.String rights, java.lang.String strACLs, java.lang.String desc) throws EACLsException
IAuthzManager
updateACLs
in interface IAuthzManager
id
- The name of the ACL entry (ie, resource id)rights
- The allowable rights for this resourcestrACLs
- The value of the ACL entrydesc
- The description for this resourceEACLsException
- when update fails.public java.util.Enumeration<IAccessEvaluator> aclEvaluatorElements()
IAuthzManager
aclEvaluatorElements
in interface IAuthzManager
public void registerEvaluator(java.lang.String type, IAccessEvaluator evaluator)
IAuthzManager
registerEvaluator
in interface IAuthzManager
type
- Type of evaluatorevaluator
- Value of evaluatorpublic java.util.Hashtable<java.lang.String,IAccessEvaluator> getAccessEvaluators()
IAuthzManager
getAccessEvaluators
in interface IAuthzManager