Class RolePermission

java.lang.Object
nzilbb.labbcat.model.RolePermission

public class RolePermission extends Object
User role permission record.

This model hides a wart in the API; it uses attribute_name instead of the now-more-correct layerId.

Author:
Robert Fromont robert@fromont.net.nz
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    RolePermission(javax.json.JsonObject json)
    Constructor from JSON.
  • Method Summary

    Modifier and Type
    Method
    Description
    Getter for entity: The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
    Getter for layerId: ID of the layer for which the label determines access.
    Getter for roleId: The ID of the role this permission applies to.
    Getter for valuePattern: Regular expression for matching against the layerId label.
    setEntity(String newEntity)
    Setter for entity: The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
    setLayerId(String newLayerId)
    Setter for layerId: ID of the layer for which the label determines access.
    setRoleId(String newRoleId)
    Setter for roleId: The ID of the role this permission applies to.
    setValuePattern(String newValuePattern)
    Setter for valuePattern: Regular expression for matching against the layerId label.
    javax.json.JsonObject
    Serializes the object to JSON.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RolePermission

      public RolePermission()
      Default constructor.
    • RolePermission

      public RolePermission(javax.json.JsonObject json)
      Constructor from JSON.
      Parameters:
      json - A JSON representation of the object to construct.
  • Method Details

    • getRoleId

      public String getRoleId()
      Getter for roleId: The ID of the role this permission applies to.
      Returns:
      The ID of the role this permission applies to.
    • setRoleId

      public RolePermission setRoleId(String newRoleId)
      Setter for roleId: The ID of the role this permission applies to.
      Parameters:
      newRoleId - The ID of the role this permission applies to.
      Returns:
      A reference to this object, so that setters can be chained.
    • getEntity

      public String getEntity()
      Getter for entity: The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
      Returns:
      The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
    • setEntity

      public RolePermission setEntity(String newEntity)
      Setter for entity: The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
      Parameters:
      newEntity - The media entity this permission applies to - a string made up of "t" (transcript), "a" (audio), "v" (video), or "i" (image).
      Returns:
      A reference to this object, so that setters can be chained.
    • getLayerId

      public String getLayerId()
      Getter for layerId: ID of the layer for which the label determines access. This is either a valid transcript attribute layer ID, or "corpus".
      Returns:
      ID of the layer for which the label determines access. This is either a valid transcript attribute layer ID, or "corpus".
    • setLayerId

      public RolePermission setLayerId(String newLayerId)
      Setter for layerId: ID of the layer for which the label determines access. This is either a valid transcript attribute layer ID, or "corpus".
      Parameters:
      newLayerId - ID of the layer for which the label determines access. This is either a valid transcript attribute layer ID, or "corpus".
      Returns:
      A reference to this object, so that setters can be chained.
    • getValuePattern

      public String getValuePattern()
      Getter for valuePattern: Regular expression for matching against the layerId label. If the regular expression matches the label, access is allowed.
      Returns:
      Regular expression for matching against the layerId label. If the regular expression matches the label, access is allowed.
    • setValuePattern

      public RolePermission setValuePattern(String newValuePattern)
      Setter for valuePattern: Regular expression for matching against the layerId label. If the regular expression matches the label, access is allowed.
      Parameters:
      newValuePattern - Regular expression for matching against the layerId label. If the regular expression matches the label, access is allowed.
      Returns:
      A reference to this object, so that setters can be chained.
    • toJson

      public javax.json.JsonObject toJson()
      Serializes the object to JSON.
      Returns:
      A JSON serialization of the object.