Class License
- All Implemented Interfaces:
IPrivilegeHolder
,Serializable
License class.
- See Also:
-
Field Summary
Fields inherited from class io.goobi.viewer.model.security.AbstractPrivilegeHolder
PRIVS_CMS, PRIVS_RECORD
Fields inherited from interface io.goobi.viewer.model.security.IPrivilegeHolder
PREFIX_PRIV, PREFIX_TICKET, PRIV_CMS_ALL_CATEGORIES, PRIV_CMS_ALL_SUBTHEMES, PRIV_CMS_ALL_TEMPLATES, PRIV_CMS_CATEGORIES, PRIV_CMS_COLLECTIONS, PRIV_CMS_MENU, PRIV_CMS_PAGES, PRIV_CMS_STATIC_PAGES, PRIV_CROWDSOURCING_ALL_CAMPAIGNS, PRIV_CROWDSOURCING_ANNOTATE_CAMPAIGN, PRIV_CROWDSOURCING_REVIEW_CAMPAIGN, PRIV_DELETE_OCR_PAGE, PRIV_DOWNLOAD_BORN_DIGITAL_FILES, PRIV_DOWNLOAD_IMAGES, PRIV_DOWNLOAD_METADATA, PRIV_DOWNLOAD_ORIGINAL_CONTENT, PRIV_DOWNLOAD_PAGE_PDF, PRIV_DOWNLOAD_PDF, PRIV_GENERATE_IIIF_MANIFEST, PRIV_LEGAL_DISCLAIMER, PRIV_LIST, PRIV_SET_REPRESENTATIVE_IMAGE, PRIV_VIEW_AUDIO, PRIV_VIEW_FULLTEXT, PRIV_VIEW_IMAGES, PRIV_VIEW_THUMBNAILS, PRIV_VIEW_UGC, PRIV_VIEW_VIDEO, PRIV_ZOOM_IMAGES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addPrivilege
(String privilege) Adds the given privilege to the working set.boolean
Getter for the fieldallowedCategories
.Getter for the fieldallowedCmsTemplates
.Getter for the fieldallowedCrowdsourcingCampaigns
.Returns the list of available record privileges for adding to this license (using the working copy while editing).getAvailablePrivileges
(Set<String> privileges) Returns the list of available record privileges for adding to this license (using the given privileges list).Getter for the fieldconditions
.Getter for the fielddescription
.getEnd()
Getter for the fieldend
.getId()
Getter for the fieldid
.Getter for the fieldipRange
.Getter for the fieldlicenseType
.Getter for the fieldprivileges
.getSortedPrivileges
(Set<String> privileges) Returns a sorted list (according to the static array of privileges, either for records or CMS) based on the given set of privileges.getStart()
Getter for the fieldstart
.Getter for the fieldsubthemeDiscriminatorValues
.getType()
getUser()
Getter for the fielduser
.Getter for the fielduserGroup
.int
hashCode()
boolean
hasPrivilege
(String privilege) hasPrivilege.boolean
boolean
isPrivCmsAllCategories.boolean
isPrivCmsAllSubthemes.boolean
isPrivCmsAllTemplates.boolean
isPrivCmsCategories.boolean
isPrivCmsCollections.boolean
isPrivCmsMenu.boolean
isPrivCmsPages.boolean
isPrivCmsStaticPages.boolean
isPrivCrowdsourcingAllCampaigns.boolean
isPrivCrowdsourcingAnnotateCampaign.boolean
isPrivCrowdsourcingReviewCampaign.boolean
isPrivViewUgc.boolean
boolean
isValid()
Checks the validity of this license.boolean
removePrivilege
(String privilege) Removes the given privilege from the working set.void
Resets all working copies of lists of various privileges.void
setAllowedCategories
(List<CMSCategory> allowedCategories) Setter for the fieldallowedCategories
.void
setAllowedCmsTemplates
(List<CMSPageTemplate> allowedCmsTemplates) Setter for the fieldallowedCmsTemplates
.void
setAllowedCrowdsourcingCampaigns
(List<Campaign> allowedCrowdsourcingCampaigns) Setter for the fieldallowedCrowdsourcingCampaigns
.void
setClient
(ClientApplication client) void
setClientId
(Long clientId) void
setConditions
(String conditions) Setter for the fieldconditions
.void
setDescription
(String description) Setter for the fielddescription
.void
setEnd
(LocalDateTime end) Setter for the fieldend
.void
Setter for the fieldid
.void
setIpRange
(IpRange ipRange) Setter for the fieldipRange
.void
setLicenseType
(LicenseType licenseType) Setter for the fieldlicenseType
.void
setPrivCmsAllCategories
(boolean priv) setPrivCmsAllCategories.void
setPrivCmsAllSubthemes
(boolean priv) setPrivCmsAllSubthemes.void
setPrivCmsAllTemplates
(boolean priv) setPrivCmsAllTemplates.void
setPrivCmsCategories
(boolean priv) setPrivCmsCategories.void
setPrivCmsCollections
(boolean priv) setPrivCmsCollections.void
setPrivCmsMenu
(boolean priv) setPrivCmsMenu.void
setPrivCmsPages
(boolean priv) setPrivCmsPages.void
setPrivCmsStaticPages
(boolean priv) setPrivCmsStaticPages.void
setPrivCrowdsourcingAllCampaigns
(boolean priv) setPrivCrowdsourcingAllCampaigns.void
setPrivCrowdsourcingAnnotateCampaign
(boolean priv) setPrivCrowdsourcingAnnotateCampaign.void
setPrivCrowdsourcingReviewCampaign
(boolean priv) setPrivCrowdsourcingReviewCampaign.void
setPrivileges
(Set<String> privileges) Setter for the fieldprivileges
.void
setPrivilegesCopy
(Set<String> privilegesCopy) void
setPrivViewUgc
(boolean priv) setPrivViewUgc.void
setStart
(LocalDateTime start) Setter for the fieldstart
.void
setSubthemeDiscriminatorValues
(List<String> subthemeDiscriminatorValues) Setter for the fieldsubthemeDiscriminatorValues
.void
setTicketRequired
(boolean ticketRequired) void
void
Setter for the fielduser
.void
setUserGroup
(UserGroup userGroup) Setter for the fielduserGroup
.
-
Constructor Details
-
License
public License()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
isValid
public boolean isValid()Checks the validity of this license. A valid license is either not time limited (start and/or end) or the current date lies between the license's start and and dates.- Returns:
- true if valid; false otherwise;
-
addPrivilege
Adds the given privilege to the working set.- Specified by:
addPrivilege
in interfaceIPrivilegeHolder
- Parameters:
privilege
-- Returns:
- true if successful; false otherwise
-
removePrivilege
Removes the given privilege from the working set.- Specified by:
removePrivilege
in interfaceIPrivilegeHolder
- Parameters:
privilege
-- Returns:
- true if successful; false otherwise
-
hasPrivilege
hasPrivilege.
- Specified by:
hasPrivilege
in interfaceIPrivilegeHolder
- Parameters:
privilege
- aString
object.- Returns:
- a boolean.
-
isPrivCmsPages
public boolean isPrivCmsPages()isPrivCmsPages.
- Specified by:
isPrivCmsPages
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsPages
public void setPrivCmsPages(boolean priv) setPrivCmsPages.
- Specified by:
setPrivCmsPages
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsAllSubthemes
public boolean isPrivCmsAllSubthemes()isPrivCmsAllSubthemes.
- Specified by:
isPrivCmsAllSubthemes
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsAllSubthemes
public void setPrivCmsAllSubthemes(boolean priv) setPrivCmsAllSubthemes.
- Specified by:
setPrivCmsAllSubthemes
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsAllCategories
public boolean isPrivCmsAllCategories()isPrivCmsAllCategories.
- Specified by:
isPrivCmsAllCategories
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsAllCategories
public void setPrivCmsAllCategories(boolean priv) setPrivCmsAllCategories.
- Specified by:
setPrivCmsAllCategories
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsAllTemplates
public boolean isPrivCmsAllTemplates()isPrivCmsAllTemplates.
- Specified by:
isPrivCmsAllTemplates
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsAllTemplates
public void setPrivCmsAllTemplates(boolean priv) setPrivCmsAllTemplates.
- Specified by:
setPrivCmsAllTemplates
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsMenu
public boolean isPrivCmsMenu()isPrivCmsMenu.
- Specified by:
isPrivCmsMenu
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsMenu
public void setPrivCmsMenu(boolean priv) setPrivCmsMenu.
- Specified by:
setPrivCmsMenu
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsStaticPages
public boolean isPrivCmsStaticPages()isPrivCmsStaticPages.
- Specified by:
isPrivCmsStaticPages
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsStaticPages
public void setPrivCmsStaticPages(boolean priv) setPrivCmsStaticPages.
- Specified by:
setPrivCmsStaticPages
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsCollections
public boolean isPrivCmsCollections()isPrivCmsCollections.
- Specified by:
isPrivCmsCollections
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsCollections
public void setPrivCmsCollections(boolean priv) setPrivCmsCollections.
- Specified by:
setPrivCmsCollections
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCmsCategories
public boolean isPrivCmsCategories()isPrivCmsCategories.
- Specified by:
isPrivCmsCategories
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCmsCategories
public void setPrivCmsCategories(boolean priv) setPrivCmsCategories.
- Specified by:
setPrivCmsCategories
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCrowdsourcingAllCampaigns
public boolean isPrivCrowdsourcingAllCampaigns()isPrivCrowdsourcingAllCampaigns.
- Specified by:
isPrivCrowdsourcingAllCampaigns
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCrowdsourcingAllCampaigns
public void setPrivCrowdsourcingAllCampaigns(boolean priv) setPrivCrowdsourcingAllCampaigns.
- Specified by:
setPrivCrowdsourcingAllCampaigns
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCrowdsourcingAnnotateCampaign
public boolean isPrivCrowdsourcingAnnotateCampaign()isPrivCrowdsourcingAnnotateCampaign.
- Specified by:
isPrivCrowdsourcingAnnotateCampaign
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCrowdsourcingAnnotateCampaign
public void setPrivCrowdsourcingAnnotateCampaign(boolean priv) setPrivCrowdsourcingAnnotateCampaign.
- Specified by:
setPrivCrowdsourcingAnnotateCampaign
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivCrowdsourcingReviewCampaign
public boolean isPrivCrowdsourcingReviewCampaign()isPrivCrowdsourcingReviewCampaign.
- Specified by:
isPrivCrowdsourcingReviewCampaign
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivCrowdsourcingReviewCampaign
public void setPrivCrowdsourcingReviewCampaign(boolean priv) setPrivCrowdsourcingReviewCampaign.
- Specified by:
setPrivCrowdsourcingReviewCampaign
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
isPrivViewUgc
public boolean isPrivViewUgc()Description copied from interface:IPrivilegeHolder
isPrivViewUgc.
- Specified by:
isPrivViewUgc
in interfaceIPrivilegeHolder
- Returns:
- a boolean.
-
setPrivViewUgc
public void setPrivViewUgc(boolean priv) Description copied from interface:IPrivilegeHolder
setPrivViewUgc.
- Specified by:
setPrivViewUgc
in interfaceIPrivilegeHolder
- Parameters:
priv
- a boolean.
-
resetTempData
public void resetTempData()Resets all working copies of lists of various privileges. -
getAvailablePrivileges
Returns the list of available record privileges for adding to this license (using the working copy while editing).- Returns:
- Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
-
getAvailablePrivileges
Returns the list of available record privileges for adding to this license (using the given privileges list).- Parameters:
privileges
-- Returns:
- Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
-
getSortedPrivileges
Returns a sorted list (according to the static array of privileges, either for records or CMS) based on the given set of privileges.- Specified by:
getSortedPrivileges
in interfaceIPrivilegeHolder
- Parameters:
privileges
- Listed privileges- Returns:
- Sorted list of privileges contained in
privileges
-
getSelectableSubthemes
- Returns:
- List<Selectablei<String>>
- Throws:
DAOException
PresentationException
-
getSelectableCategories
- Returns:
- List<Selectable<CMSCategory>>
- Throws:
DAOException
-
getSelectableTemplates
- Returns:
- List<Selectable<CMSPageTemplate>>
- Throws:
DAOException
-
getId
Getter for the field
id
.- Returns:
- the id
-
setId
Setter for the field
id
.- Parameters:
id
- the id to set
-
getLicenseType
Getter for the field
licenseType
.- Returns:
- the licenseType
-
setLicenseType
Setter for the field
licenseType
.- Parameters:
licenseType
- the licenseType to set
-
getUser
Getter for the field
user
.- Returns:
- the user
-
setUser
Setter for the field
user
.- Parameters:
user
- the user to set
-
getUserGroup
Getter for the field
userGroup
.- Returns:
- the userGroup
-
setUserGroup
Setter for the field
userGroup
.- Parameters:
userGroup
- the userGroup to set
-
getIpRange
Getter for the field
ipRange
.- Returns:
- the ipRange
-
setIpRange
Setter for the field
ipRange
.- Parameters:
ipRange
- the ipRange to set
-
getStart
Getter for the field
start
.- Returns:
- the start
-
setStart
Setter for the field
start
.- Parameters:
start
- the start to set
-
getEnd
Getter for the field
end
.- Returns:
- the end
-
setEnd
Setter for the field
end
.- Parameters:
end
- the end to set
-
getPrivileges
Getter for the field
privileges
.- Returns:
- the privileges
-
setPrivileges
Setter for the field
privileges
.- Parameters:
privileges
- the privileges to set
-
getConditions
Getter for the field
conditions
.- Returns:
- the conditions
-
setConditions
Setter for the field
conditions
.- Parameters:
conditions
- the conditions to set
-
getDescription
Getter for the field
description
.- Returns:
- the description
-
setDescription
Setter for the field
description
.- Parameters:
description
- the description to set
-
isTicketRequired
public boolean isTicketRequired()- Returns:
- the ticketRequired
-
setTicketRequired
public void setTicketRequired(boolean ticketRequired) - Parameters:
ticketRequired
- the ticketRequired to set
-
isDisplayTicketRequiredToggle
public boolean isDisplayTicketRequiredToggle()- Returns:
- true if privilege PRIV_DOWNLOAD_BORN_DIGITAL_FILES is contained; false otherwise
-
getSubthemeDiscriminatorValues
Getter for the field
subthemeDiscriminatorValues
.- Returns:
- the subthemeDiscriminatorValues
-
setSubthemeDiscriminatorValues
Setter for the field
subthemeDiscriminatorValues
.- Parameters:
subthemeDiscriminatorValues
- the subthemeDiscriminatorValues to set
-
getAllowedCategories
Getter for the field
allowedCategories
.- Returns:
- the allowedCategories
-
setAllowedCategories
Setter for the field
allowedCategories
.- Parameters:
allowedCategories
- the allowedCategories to set
-
getAllowedCmsTemplates
Getter for the field
allowedCmsTemplates
.- Returns:
- the allowedCmsTemplates
-
setAllowedCmsTemplates
Setter for the field
allowedCmsTemplates
.- Parameters:
allowedCmsTemplates
- the allowedCmsTemplates to set
-
getAllowedCrowdsourcingCampaigns
Getter for the field
allowedCrowdsourcingCampaigns
.- Returns:
- the allowedCrowdsourcingCampaigns
-
setAllowedCrowdsourcingCampaigns
Setter for the field
allowedCrowdsourcingCampaigns
.- Parameters:
allowedCrowdsourcingCampaigns
- the allowedCrowdsourcingCampaigns to set
-
getType
- Returns:
- the type
-
setType
- Parameters:
type
- the type to set
-
getPrivilegesCopy
- Returns:
- the privilegesCopy
-
setPrivilegesCopy
- Parameters:
privilegesCopy
- the privilegesCopy to set
-
getDisclaimerScope
-
getClientId
- Returns:
- the client
-
getClient
-
setClient
- Parameters:
client
- the client to set
-
setClientId
- Parameters:
clientId
- the clientId to set- Throws:
DAOException
-