Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public Class StatementTablePermission

extends StatementPermission
Class Inheritance
Known Direct Subclasses
org.apache.derby.iapi.sql.dictionary.StatementColumnPermission
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.catalog.UUID, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.execute.ExecPreparedStatement, org.apache.derby.iapi.sql.depend.DependencyManager, org.apache.derby.iapi.services.context.ContextManager

This class describes a table permission required by a statement.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv UUID

Constructor Summary

AccessConstructor and Description
public
StatementTablePermission(UUID
UUID of the table
tableUUID
,
int
Access privilege requested
privType
)

Constructor for StatementTablePermission.

Method Summary

Modifier and TypeMethod and Description
public void
check(LanguageConnectionContext
LanguageConnectionContext
lcc
,
boolean forGrant, Activation
activation for statement needing check
activation
)

Implements abstract org.apache.derby.iapi.sql.dictionary.StatementPermission.check.

public boolean

Returns:

true if match
equals
(Object
Another instance of StatementPermission
obj
)

Overrides java.lang.Object.equals.

Routine to check if another instance of access descriptor matches this.

public PermissionsDescriptor
getPermissionDescriptor(String
AuthorizationId
authid
,
DataDictionary
DataDictionary
dd
)

Implements abstract org.apache.derby.iapi.sql.dictionary.StatementPermission.getPermissionDescriptor.

Get the PermissionsDescriptor for the passed authorization id for this object.

public String

Returns:

privilege string
getPrivName
()

Return privilege needed for this access as string

public int

Returns:

Privilege access
getPrivType
()

Return privilege access requested for this access descriptor

protected TableDescriptor
public UUID

Returns:

Table UUID
getTableUUID
()

Return table UUID for this access descriptor

public int

Returns:

Hashcode
hashCode
()

Overrides java.lang.Object.hashCode.

Return hash code for this instance

protected boolean
hasPermissionOnTable(LanguageConnectionContext
the current language connection context
lcc
,
Activation
the activation of ps
activation
,
boolean
true if FOR GRANT is required
forGrant
,
ExecPreparedStatement
the prepared statement for which we are checking necessary privileges
ps
)

Check if current session has permission on the table (current user, PUBLIC or role) and, if applicable, register a dependency of ps on the current role.

protected boolean
oneAuthHasPermissionOnTable(DataDictionary dd, String authorizationId, boolean forGrant)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.iapi.sql.dictionary.StatementPermission:
genericCheckgetObjectTypegetPrivilegedObjectisCorrectPermission

Field Detail

privTypeback to summary
pack-priv int privType
tableUUIDback to summary
pack-priv UUID tableUUID

Constructor Detail

StatementTablePermissionback to summary
public StatementTablePermission(UUID tableUUID, int privType)

Constructor for StatementTablePermission. Creates an instance of table permission requested for the given access.

Parameters
tableUUID:UUID

UUID of the table

privType:int

Access privilege requested

Method Detail

checkback to summary
public void check(LanguageConnectionContext lcc, boolean forGrant, Activation activation) throws StandardException

Implements abstract org.apache.derby.iapi.sql.dictionary.StatementPermission.check.

Parameters
lcc:LanguageConnectionContext

Doc from org.apache.derby.iapi.sql.dictionary.StatementPermission.check.

LanguageConnectionContext

activation:Activation

Doc from org.apache.derby.iapi.sql.dictionary.StatementPermission.check.

activation for statement needing check

Exceptions
StandardException:

Doc from org.apache.derby.iapi.sql.dictionary.StatementPermission.check.

if the permission has not been granted

See Also
StatementPermission#check
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Routine to check if another instance of access descriptor matches this. Used to ensure only one access descriptor for a table of given privilege is created. Otherwise, every column reference from a table may create a descriptor for that table.

Parameters
obj:Object

Another instance of StatementPermission

Returns:boolean

true if match

getPermissionDescriptorback to summary
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd) throws StandardException

Implements abstract org.apache.derby.iapi.sql.dictionary.StatementPermission.getPermissionDescriptor.

Doc from org.apache.derby.iapi.sql.dictionary.StatementPermission.getPermissionDescriptor.

Get the PermissionsDescriptor for the passed authorization id for this object. This method gets called during the execution phase of create view/constraint/trigger. The return value of this method is saved in dependency system to keep track of views/constraints/triggers dependencies on required permissions. This happens in execution phase after it has been established that passed authorization id has all the permissions it needs to create that view/constraint/trigger. Which means that we can only get to writing into dependency system once all the required privileges are confirmed.

Parameters
authid:String

AuthorizationId

dd:DataDictionary

DataDictionary

Returns:PermissionsDescriptor

PermissionsDescriptor The PermissionsDescriptor for the passed authorization id on this object

See Also
StatementPermission#getPermissionDescriptor
getPrivNameback to summary
public String getPrivName()

Return privilege needed for this access as string

Returns:String

privilege string

getPrivTypeback to summary
public int getPrivType()

Return privilege access requested for this access descriptor

Returns:int

Privilege access

getTableDescriptorback to summary
protected TableDescriptor getTableDescriptor(DataDictionary dd) throws StandardException
getTableUUIDback to summary
public UUID getTableUUID()

Return table UUID for this access descriptor

Returns:UUID

Table UUID

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Return hash code for this instance

Returns:int

Hashcode

hasPermissionOnTableback to summary
protected boolean hasPermissionOnTable(LanguageConnectionContext lcc, Activation activation, boolean forGrant, ExecPreparedStatement ps) throws StandardException

Check if current session has permission on the table (current user, PUBLIC or role) and, if applicable, register a dependency of ps on the current role.

Parameters
lcc:LanguageConnectionContext

the current language connection context

activation:Activation

the activation of ps

forGrant:boolean

true if FOR GRANT is required

ps:ExecPreparedStatement

the prepared statement for which we are checking necessary privileges

oneAuthHasPermissionOnTableback to summary
protected boolean oneAuthHasPermissionOnTable(DataDictionary dd, String authorizationId, boolean forGrant) throws StandardException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object