Class AbstractLicensee
java.lang.Object
io.goobi.viewer.model.security.user.AbstractLicensee
- All Implemented Interfaces:
ILicensee
- Direct Known Subclasses:
ClientApplication,IpRange,User,UserGroup
Abstract base class for entities (users and user groups) that can hold access licenses.
Provides shared logic for license retrieval, access permission evaluation, and privilege checks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessPermissiongetAccessPermissionFromMap(Map<String, AccessPermission> permissionMap) getLicenses.hasLicense(String licenseName, String privilegeName, String pi) Checks whether the licensee has a license with the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.security.ILicensee
getAccessType, getName
-
Constructor Details
-
AbstractLicensee
public AbstractLicensee()
-
-
Method Details
-
getLicenses
getLicenses.- Specified by:
getLicensesin interfaceILicensee- Returns:
- a list of licenses assigned to this licensee
-
hasLicense
public AccessPermission hasLicense(String licenseName, String privilegeName, String pi) throws PresentationException, IndexUnreachableException, DAOException Checks whether the licensee has a license with the given name. IF a privilege name is passed, the licensee must also have this privilege for that license.- Specified by:
hasLicensein interfaceILicensee- Parameters:
licenseName- License name.privilegeName- Required privilege (optional).pi- Checks the privilege in connection with a specific record identifier (optional).- Returns:
- true if the licensee holds a matching license (and the required privilege if specified), false otherwise
- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException
-
getAccessPermissionFromMap
public static AccessPermission getAccessPermissionFromMap(Map<String, AccessPermission> permissionMap) - Parameters:
permissionMap- Map containing permission check outcome for different license names- Returns:
AccessPermission
-