Class PermDescriptor
- java.lang.Object
-
- org.apache.derby.iapi.sql.dictionary.TupleDescriptor
-
- org.apache.derby.iapi.sql.dictionary.PermissionsDescriptor
-
- org.apache.derby.iapi.sql.dictionary.PermDescriptor
-
- All Implemented Interfaces:
java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.String
AGGREGATE_TYPE
private boolean
grantable
private java.lang.String
objectType
private java.lang.String
permission
private UUID
permObjectId
static java.lang.String
SEQUENCE_TYPE
static java.lang.String
UDT_TYPE
static java.lang.String
USAGE_PRIV
-
Fields inherited from class org.apache.derby.iapi.sql.dictionary.PermissionsDescriptor
oid
-
Fields inherited from interface org.apache.derby.catalog.Dependable
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW
-
-
Constructor Summary
Constructors Constructor Description PermDescriptor(DataDictionary dd, UUID permUUID)
PermDescriptor(DataDictionary dataDictionary, UUID permUUID, java.lang.String objectType, UUID permObjectId, java.lang.String permission, java.lang.String grantor, java.lang.String grantee, boolean isGrantable)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkOwner(java.lang.String authorizationId)
This method checks if the passed authorization id is same as the owner of the object on which this permission is defined.boolean
equals(java.lang.Object other)
int
getCatalogNumber()
java.lang.String
getClassType()
Get the provider's type.DependableFinder
getDependableFinder()
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.java.lang.String
getObjectName()
Return the name of this Provider.java.lang.String
getObjectType()
java.lang.String
getPermission()
UUID
getPermObjectId()
static PrivilegedSQLObject
getProtectedObject(DataDictionary dd, UUID objectID, java.lang.String objectType)
Get the protected object.int
hashCode()
boolean
isGrantable()
java.lang.String
toString()
-
Methods inherited from class org.apache.derby.iapi.sql.dictionary.PermissionsDescriptor
clone, getGrantee, getGrantor, getObjectID, getUUID, isPersistent, keyEquals, keyHashCode, setGrantee, setUUID
-
Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
getColumnDependableFinder, getDataDictionary, getDependableFinder, getDescriptorName, getDescriptorType, setDataDictionary
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.derby.catalog.Dependable
getObjectID, isPersistent
-
-
-
-
Field Detail
-
SEQUENCE_TYPE
public static final java.lang.String SEQUENCE_TYPE
- See Also:
- Constant Field Values
-
UDT_TYPE
public static final java.lang.String UDT_TYPE
- See Also:
- Constant Field Values
-
AGGREGATE_TYPE
public static final java.lang.String AGGREGATE_TYPE
- See Also:
- Constant Field Values
-
USAGE_PRIV
public static final java.lang.String USAGE_PRIV
- See Also:
- Constant Field Values
-
objectType
private java.lang.String objectType
-
permObjectId
private UUID permObjectId
-
permission
private java.lang.String permission
-
grantable
private boolean grantable
-
-
Constructor Detail
-
PermDescriptor
public PermDescriptor(DataDictionary dataDictionary, UUID permUUID, java.lang.String objectType, UUID permObjectId, java.lang.String permission, java.lang.String grantor, java.lang.String grantee, boolean isGrantable)
Constructor- Parameters:
dataDictionary
- data dictionarypermUUID
- unique identification in time and space of this perm descriptorobjectType
- E.g., SEQUENCE_TYPEpermObjectId
- Unique id of the object being protectedpermission
- E.g., USAGE_PRIVgrantor
- Authorization id which confers the privilegegrantee
- Authorization id which receives the privilegeisGrantable
- True if the privilege can be granted onwards
-
PermDescriptor
public PermDescriptor(DataDictionary dd, UUID permUUID) throws StandardException
- Throws:
StandardException
-
-
Method Detail
-
getObjectType
public java.lang.String getObjectType()
-
getPermObjectId
public UUID getPermObjectId()
-
getPermission
public java.lang.String getPermission()
-
isGrantable
public boolean isGrantable()
-
getCatalogNumber
public int getCatalogNumber()
- Specified by:
getCatalogNumber
in classPermissionsDescriptor
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.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 classjava.lang.Object
- Returns:
- the hashCode for the key part of this permissions descriptor
-
checkOwner
public boolean checkOwner(java.lang.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 classPermissionsDescriptor
- Returns:
- boolean If passed authorization id is owner of the table
- Throws:
StandardException
- See Also:
PermissionsDescriptor.checkOwner(java.lang.String)
-
getProtectedObject
public static PrivilegedSQLObject getProtectedObject(DataDictionary dd, UUID objectID, java.lang.String objectType) throws StandardException
Get the protected object.- Parameters:
dd
- MetadataobjectID
- Unique handle on the protected objectobjectType
- Type of the object- Throws:
StandardException
-
getObjectName
public java.lang.String getObjectName()
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectName
in interfaceDependable
- Returns:
- String The name of this provider.
-
getClassType
public java.lang.String getClassType()
Get the provider's type.- Specified by:
getClassType
in interfaceDependable
- 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 interfaceDependable
- Returns:
- the stored form of this provider
- See Also:
Dependable.getDependableFinder()
-
-