Class PermDescriptor

All Implemented Interfaces:
Cloneable, Dependable, Provider

public class PermDescriptor extends PermissionsDescriptor implements Provider
This class describes rows in the SYS.SYSPERMS system table, which keeps track of the permissions that have been granted but not revoked.
  • Field Details

  • Constructor Details

    • PermDescriptor

      public PermDescriptor(DataDictionary dataDictionary, UUID permUUID, String objectType, UUID permObjectId, String permission, String grantor, String grantee, boolean isGrantable)
      Constructor
      Parameters:
      dataDictionary - data dictionary
      permUUID - unique identification in time and space of this perm descriptor
      objectType - E.g., SEQUENCE_TYPE
      permObjectId - Unique id of the object being protected
      permission - E.g., USAGE_PRIV
      grantor - Authorization id which confers the privilege
      grantee - Authorization id which receives the privilege
      isGrantable - True if the privilege can be granted onwards
    • PermDescriptor

      public PermDescriptor(DataDictionary dd, UUID permUUID) throws StandardException
      Throws:
      StandardException
  • Method Details

    • getObjectType

      public String getObjectType()
    • getPermObjectId

      public UUID getPermObjectId()
    • getPermission

      public String getPermission()
    • isGrantable

      public boolean isGrantable()
    • getCatalogNumber

      public int getCatalogNumber()
      Specified by:
      getCatalogNumber in class PermissionsDescriptor
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      Returns:
      true iff the key part of this perm descriptor equals the key part of another perm descriptor.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      the hashCode for the key part of this permissions descriptor
    • checkOwner

      public boolean checkOwner(String authorizationId) throws StandardException
      Description copied from class: PermissionsDescriptor
      This method checks if the passed authorization id is same as the owner of the object on which this permission is defined. This method gets called by create view/constraint/trigger to see if this permission needs to be saved in dependency system for the view/constraint/trigger. If the same user is the owner of the the object being accessed and the newly created object, then no need to keep this privilege dependency
      Specified by:
      checkOwner in class PermissionsDescriptor
      Returns:
      boolean If passed authorization id is owner of the table
      Throws:
      StandardException
      See Also:
    • getProtectedObject

      public static PrivilegedSQLObject getProtectedObject(DataDictionary dd, UUID objectID, String objectType) throws StandardException
      Get the protected object.
      Parameters:
      dd - Metadata
      objectID - Unique handle on the protected object
      objectType - Type of the object
      Throws:
      StandardException
    • getObjectName

      public String getObjectName()
      Return the name of this Provider. (Useful for errors.)
      Specified by:
      getObjectName in interface Dependable
      Returns:
      String The name of this provider.
    • getClassType

      public String getClassType()
      Get the provider's type.
      Specified by:
      getClassType in interface Dependable
      Returns:
      char The provider's type.
    • getDependableFinder

      public DependableFinder getDependableFinder()
      Description copied from interface: Dependable
      Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.
      Specified by:
      getDependableFinder in interface Dependable
      Returns:
      the stored form of this provider
      See Also: