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

public abstract Class StatementPermission

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.iapi.sql.dictionary.StatementRolePermission, org.apache.derby.iapi.sql.dictionary.StatementRoutinePermission, org.apache.derby.iapi.sql.dictionary.StatementSchemaPermission, org.apache.derby.iapi.sql.dictionary.StatementTablePermission, org.apache.derby.iapi.sql.dictionary.StatementGenericPermission
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.store.access.TransactionController, 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 permission require by a statement.

Constructor Summary

AccessConstructor and Description
pack-priv
StatementPermission()

Restrict implementations to this package to reduce risk of external code spoofing the GRANT/REVOKE system by providing its own fake implementations.

Method Summary

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

public void
genericCheck(LanguageConnectionContext lcc, boolean forGrant, Activation activation, String privilegeType)

Generic logic called by check() for USAGE and EXECUTE privileges.

public String
getObjectType()

Get the type of the privileged object.

public abstract PermissionsDescriptor

Returns:

PermissionsDescriptor The PermissionsDescriptor for the passed authorization id on this object
getPermissionDescriptor
(String
AuthorizationId
authid
,
DataDictionary
DataDictionary
dd
)

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

public PrivilegedSQLObject
getPrivilegedObject(DataDictionary dd)

Get the privileged object associated with this permission.

public boolean
isCorrectPermission(PermissionsDescriptor pd)

Return true if the passed in permission matches the one required by this StatementPermission.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StatementPermissionback to summary
pack-priv StatementPermission()

Restrict implementations to this package to reduce risk of external code spoofing the GRANT/REVOKE system by providing its own fake implementations.

Method Detail

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

LanguageConnectionContext

activation:Activation

activation for statement needing check

Exceptions
StandardException:
if the permission has not been granted
genericCheckback to summary
public void genericCheck(LanguageConnectionContext lcc, boolean forGrant, Activation activation, String privilegeType) throws StandardException

Generic logic called by check() for USAGE and EXECUTE privileges. Throws an exception if the correct permission cannot be found.

getObjectTypeback to summary
public String getObjectType()

Get the type of the privileged object.

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

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

getPrivilegedObjectback to summary
public PrivilegedSQLObject getPrivilegedObject(DataDictionary dd) throws StandardException

Get the privileged object associated with this permission.

isCorrectPermissionback to summary
public boolean isCorrectPermission(PermissionsDescriptor pd) throws StandardException

Return true if the passed in permission matches the one required by this StatementPermission.