Package digilib.auth
Class PathAuthzOps
- java.lang.Object
-
- digilib.auth.AuthzOpsImpl
-
- digilib.auth.PathAuthzOps
-
- All Implemented Interfaces:
AuthzOps
public class PathAuthzOps extends AuthzOpsImpl
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>
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Fields inherited from class digilib.auth.AuthzOpsImpl
authnOps
-
-
Constructor Summary
Constructors Constructor Description PathAuthzOps()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init(DigilibConfiguration dlConfig)
Initialize authentication operations.List<String>
rolesForPath(DigilibServletRequest dlRequest)
Return authorization roles needed for request.-
Methods inherited from class digilib.auth.AuthzOpsImpl
isAuthorizationRequired, isAuthorized, isRoleAuthorized
-
-
-
-
Method Detail
-
init
public void init(DigilibConfiguration dlConfig) throws AuthOpException
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
public List<String> rolesForPath(DigilibServletRequest dlRequest) throws AuthOpException
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.
-
-