Class Role

java.lang.Object
io.goobi.viewer.model.security.Role
All Implemented Interfaces:
Serializable

@Entity public class Role extends Object implements 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 Details

  • Constructor Details

    • Role

      public Role()
      Empty constructor.
    • Role

      public Role(String name)
      Creates a new Role instance.
      Parameters:
      name - unique name identifying this role
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hasPrivilege

      public boolean hasPrivilege(String privilegeName)
      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

      public Long getId()
      Getter for the field id.
      Returns:
      the database primary key for this role
    • setId

      public void setId(Long id)
      Setter for the field id.
      Parameters:
      id - the database primary key for this role
    • getName

      public String getName()
      Getter for the field name.
      Returns:
      the unique name identifying this role
    • setName

      public void setName(String name)
      Setter for the field name.
      Parameters:
      name - the unique name identifying this role
    • getDescription

      public String getDescription()
      Getter for the field description.
      Returns:
      the human-readable description of this role
    • setDescription

      public void setDescription(String description)
      Setter for the field description.
      Parameters:
      description - the human-readable description of this role
    • getPrivileges

      public Set<String> getPrivileges()
      Getter for the field privileges.
      Returns:
      the set of privilege names granted by this role
    • setPrivileges

      public void setPrivileges(Set<String> privileges)
      Setter for the field privileges.
      Parameters:
      privileges - the set of privilege names granted by this role
    • getInheritedRoles

      public Set<Role> getInheritedRoles()
      Getter for the field inheritedRoles.
      Returns:
      the set of roles whose privileges are inherited by this role
    • setInheritedRoles

      public void setInheritedRoles(Set<Role> inheritedRoles)
      Setter for the field inheritedRoles.
      Parameters:
      inheritedRoles - the set of roles whose privileges are inherited by this role
    • toString

      public String toString()
      Overrides:
      toString in class Object