Class DirAclAuthz
java.lang.Object
com.netscape.cms.authorization.AAclAuthz
com.netscape.cms.authorization.DirAclAuthz
- All Implemented Interfaces:
IExtendedPluginInfo, IAuthzManager
A class for ldap acls based authorization manager
The ldap server used for acls is the cms internal ldap db.
- Version:
- $Revision$, $Date$
-
Nested Class Summary
Nested classes/interfaces inherited from class AAclAuthz
AAclAuthz.EvaluationOrder -
Field Summary
FieldsFields inherited from class AAclAuthz
ACLS_ATTR, mConfigParams, mExtendedPluginInfo, PROP_CLASS, PROP_EVAL, PROP_IMPLFields inherited from interface IExtendedPluginInfo
HELP_TEXT, HELP_TOKEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidupdates resourceACLs to ldap.protected netscape.ldap.LDAPConnectiongetConn()voidinit(String name, String implName, AuthzManagerConfig config) Initializesprotected voidreturnConn(netscape.ldap.LDAPConnection conn) voidshutdown()graceful shutdownvoidupdateACLs(String id, String rights, String strACLs, String desc) update acls.Methods inherited from class AAclAuthz
accessInit, aclEvaluatorElements, aclResElements, addACLs, authorize, authorize, checkAllowEntries, checkDenyEntries, checkPermission, checkPermission, evaluateACLs, getAccessEvaluators, getACL, getACLs, getConfigParams, getConfigStore, getEntries, getExtendedPluginInfo, getImplName, getName, getNodes, getOrder, getTargetNames, isTypeUnique, registerEvaluatorModifier and TypeMethodDescriptionvoidaccessInit(String accessInfo) accessInitis for servlets who want to initialize their own authorization information before full operation.gets an enumeration of access evaluatorsgets an enumeration of resourcesvoidParse ACL resource attributes, then update the ACLs memory store This is intended to be used if storing ACLs on ldap is not desired, and the caller is expected to call this method to add resource and acl info into acls memory store.authorize(IAuthToken authToken, String expression) authorize(IAuthToken authToken, String resource, String operation) check the authorization permission for the user associated with authToken on operation Example: For example, if UsrGrpAdminServlet needs to authorize the caller it would do be done in the following fashion: try { authzTok = mAuthz.authorize( "DirAclAuthz", authToken, RES_GROUP, "read"); } catch (EBaseException e) { logger.warn("authorize call: " + e.getMessage(), e); }protected booleancheckAllowEntries(IAuthToken authToken, Iterable<String> nodes, String perm) protected voidcheckDenyEntries(IAuthToken authToken, Iterable<String> nodes, String perm) throw EACLsException if a deny entry is matchedvoidcheckPermission(IAuthToken authToken, String name, String perm) Checks if the permission is granted or denied with id from authtoken gotten from authentication that precedes authorization.protected voidcheckPermission(String name, String perm) Checks if the permission is granted or denied in the current execution context.booleanevaluateACLs(IAuthToken authToken, String exp) gets the access evaluatorsGet individual ACL entry for the given name of entry.getACLs()Get ACL entriesString[]Returns a list of configuration parameter names.Returns the configuration store used by this Authz mgrgetEntries(ACLEntry.Type entryType, Iterable<String> nodes, String operation) String[]getExtendedPluginInfo(Locale locale) gets the plugin name of this authorization manager.getName()gets the name of this authorization manager instancestatic AAclAuthz.EvaluationOrdergetOrder()protected Enumeration<String> booleanisTypeUnique(String type) is this resource name uniquevoidregisterEvaluator(String type, IAccessEvaluator evaluator) Registers new handler for the given attribute type in the expressions.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IExtendedPluginInfo
getExtendedPluginInfoModifier and TypeMethodDescriptionString[]getExtendedPluginInfo(Locale locale) This method returns an array of strings.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
PROP_SEARCHBASE
- See Also:
-
-
Constructor Details
-
DirAclAuthz
public DirAclAuthz()Default constructor
-
-
Method Details
-
init
Description copied from class:AAclAuthzInitializes- Specified by:
initin interfaceIAuthzManager- Overrides:
initin classAAclAuthz- Parameters:
name- The name of this authorization manager instance.implName- The name of the authorization manager plugin.config- The configuration store for this authorization manager.- Throws:
EBaseException- If an initialization error occurred.
-
updateACLs
update acls. when memory update is done, flush to ldap.Currently, it is possible that when the memory is updated successfully, and the ldap isn't, the memory upates lingers. The result is that the changes will only be done on ldap at the next update, or when the system shuts down, another flush will be attempted.
- Specified by:
updateACLsin interfaceIAuthzManager- Overrides:
updateACLsin classAAclAuthz- Parameters:
id- is the resource idrights- The allowable rights for this resourcestrACLs- has the same format as a resourceACLs entry acis on the ldap serverdesc- The description for this resource- Throws:
EACLsException- when update fails.
-
flushResourceACLs
updates resourceACLs to ldap.- Throws:
EACLsException
-
getConn
- Throws:
ELdapException
-
returnConn
- Throws:
ELdapException
-
shutdown
public void shutdown()graceful shutdown- Specified by:
shutdownin interfaceIAuthzManager- Specified by:
shutdownin classAAclAuthz
-