Package io.goobi.viewer.model.security
Class Role
java.lang.Object
io.goobi.viewer.model.security.Role
- All Implemented Interfaces:
Serializable
Represents a role a user can have within a user group. Contains a set of privileges. A role can also inherit from other roles. The full potential
of this class is not in use at the moment.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGetter for the fielddescription.getId()Getter for the fieldid.Getter for the fieldinheritedRoles.getName()Getter for the fieldname.Getter for the fieldprivileges.inthashCode()booleanhasPrivilege(String privilegeName) Checks whether this role or any role from which this role inherits has the privilege with the given name.booleanisPrivCmsCategories.booleanisPrivCmsCollections.booleanisPrivCmsMenu.booleanisPrivCmsPages.booleanisPrivCmsStaticPages.booleanisPrivDeleteOcrPage.booleanisPrivSetRepresentativeImage.voidsetDescription(String description) Setter for the fielddescription.voidSetter for the fieldid.voidsetInheritedRoles(Set<Role> inheritedRoles) Setter for the fieldinheritedRoles.voidSetter for the fieldname.voidsetPrivCmsCategories(boolean priv) setPrivCmsCategories.voidsetPrivCmsCollections(boolean priv) setPrivCmsCollections.voidsetPrivCmsMenu(boolean priv) setPrivCmsMenu.voidsetPrivCmsPages(boolean priv) setPrivCmsPages.voidsetPrivCmsStaticPages(boolean priv) setPrivCmsStaticPages.voidsetPrivDeleteOcrPage(boolean priv) setPrivDeleteOcrPage.voidsetPrivileges(Set<String> privileges) Setter for the fieldprivileges.voidsetPrivSetRepresentativeImage(boolean priv) setPrivSetRepresentativeImage.toString()
-
Field Details
-
SUPERUSER_ROLE
ConstantSUPERUSER_ROLE="admin".- See Also:
-
-
Constructor Details
-
Role
public Role()Empty constructor. -
Role
Creates a new Role instance.- Parameters:
name- unique name identifying this role
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
hasPrivilege
Checks whether this role or any role from which this role inherits has the privilege with the given name.- Parameters:
privilegeName- The name of the priv to check for.- Returns:
- true if any of the roles has this privilege; false otherwise.
-
isPrivDeleteOcrPage
public boolean isPrivDeleteOcrPage()isPrivDeleteOcrPage.- Returns:
- true if this role grants the privilege to delete OCR page content, false otherwise
-
setPrivDeleteOcrPage
public void setPrivDeleteOcrPage(boolean priv) setPrivDeleteOcrPage.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivSetRepresentativeImage
public boolean isPrivSetRepresentativeImage()isPrivSetRepresentativeImage.- Returns:
- true if this role grants the privilege to set the representative image for a record, false otherwise
-
setPrivSetRepresentativeImage
public void setPrivSetRepresentativeImage(boolean priv) setPrivSetRepresentativeImage.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivCmsPages
public boolean isPrivCmsPages()isPrivCmsPages.- Returns:
- true if this role grants the privilege to manage CMS pages, false otherwise
-
setPrivCmsPages
public void setPrivCmsPages(boolean priv) setPrivCmsPages.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivCmsMenu
public boolean isPrivCmsMenu()isPrivCmsMenu.- Returns:
- true if this role grants the privilege to manage the CMS navigation menu, false otherwise
-
setPrivCmsMenu
public void setPrivCmsMenu(boolean priv) setPrivCmsMenu.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivCmsStaticPages
public boolean isPrivCmsStaticPages()isPrivCmsStaticPages.- Returns:
- true if this role grants the privilege to manage CMS static pages, false otherwise
-
setPrivCmsStaticPages
public void setPrivCmsStaticPages(boolean priv) setPrivCmsStaticPages.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivCmsCollections
public boolean isPrivCmsCollections()isPrivCmsCollections.- Returns:
- true if this role grants the privilege to manage CMS collections, false otherwise
-
setPrivCmsCollections
public void setPrivCmsCollections(boolean priv) setPrivCmsCollections.- Parameters:
priv- true to grant, false to revoke the privilege
-
isPrivCmsCategories
public boolean isPrivCmsCategories()isPrivCmsCategories.- Returns:
- true if this role grants the privilege to manage CMS categories, false otherwise
-
setPrivCmsCategories
public void setPrivCmsCategories(boolean priv) setPrivCmsCategories.- Parameters:
priv- true to grant, false to revoke the privilege
-
getId
Getter for the fieldid.- Returns:
- the database primary key for this role
-
setId
Setter for the fieldid.- Parameters:
id- the database primary key for this role
-
getName
Getter for the fieldname.- Returns:
- the unique name identifying this role
-
setName
Setter for the fieldname.- Parameters:
name- the unique name identifying this role
-
getDescription
Getter for the fielddescription.- Returns:
- the human-readable description of this role
-
setDescription
Setter for the fielddescription.- Parameters:
description- the human-readable description of this role
-
getPrivileges
Getter for the fieldprivileges.- Returns:
- the set of privilege names granted by this role
-
setPrivileges
Setter for the fieldprivileges.- Parameters:
privileges- the set of privilege names granted by this role
-
getInheritedRoles
Getter for the fieldinheritedRoles.- Returns:
- the set of roles whose privileges are inherited by this role
-
setInheritedRoles
Setter for the fieldinheritedRoles.- Parameters:
inheritedRoles- the set of roles whose privileges are inherited by this role
-
toString
-