Package digilib.auth
Class PathAuthzOps
java.lang.Object
digilib.auth.AuthzOpsImpl
digilib.auth.PathAuthzOps
- All Implemented Interfaces:
AuthzOps
Implements AuthzOps using paths defined in an XML config file.
The name of the configuration file is read from the digilib config parameter "auth-file".
The tag "digilib-paths" is read from the configuration file:
<digilib-paths>
<path name="histast/eastwood-collection" role="eastwood-coll" />
</digilib-paths>
A user must supply one of the roles under "role" to access the directory "name".
Roles under "role" must be separated by comma only (no spaces).-
Field Summary
FieldsFields inherited from class digilib.auth.AuthzOpsImpl
authnOps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(DigilibConfiguration dlConfig) Initialize authentication operations.rolesForPath
(DigilibServletRequest dlRequest) Return authorization roles needed for request.Methods inherited from class digilib.auth.AuthzOpsImpl
isAuthorizationRequired, isAuthorized, isRoleAuthorized
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
PathAuthzOps
public PathAuthzOps()
-
-
Method Details
-
init
Initialize authentication operations. Reads tag "digilib-paths" from configuration file and sets up authentication arrays.- Specified by:
init
in interfaceAuthzOps
- Specified by:
init
in classAuthzOpsImpl
- Parameters:
dlConfig
- current DigilibConfiguration- Throws:
AuthOpException
- Exception thrown on error.
-
rolesForPath
Return authorization roles needed for request. Returns the list of authorization roles that are required to access the specified path. No list means the path is free.- Specified by:
rolesForPath
in classAuthzOpsImpl
- Parameters:
dlRequest
- DigilibServletRequest with image path and remote address information.- Returns:
- List of Strings with role names.
- Throws:
AuthOpException
- Exception thrown on error.
-