org.apache.derby.iapi.sql.dictionary
Class StatementPermission

java.lang.Object
  extended by org.apache.derby.iapi.sql.dictionary.StatementPermission
Direct Known Subclasses:
StatementGenericPermission, StatementRolePermission, StatementRoutinePermission, StatementSchemaPermission, StatementTablePermission

public abstract class StatementPermission
extends java.lang.Object

This class describes a permission require by a statement.


Constructor Summary
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
abstract  void check(LanguageConnectionContext lcc, java.lang.String authorizationId, boolean forGrant, Activation activation)
           
 void genericCheck(LanguageConnectionContext lcc, java.lang.String authorizationId, boolean forGrant, Activation activation, java.lang.String privilegeType)
          Generic logic called by check() for USAGE and EXECUTE privileges.
 java.lang.String getObjectType()
          Get the type of the privileged object.
abstract  PermissionsDescriptor getPermissionDescriptor(java.lang.String authid, DataDictionary dd)
          Get the PermissionsDescriptor for the passed authorization id for this object.
 PrivilegedSQLObject getPrivilegedObject(DataDictionary dd)
          Get the privileged object associated with this permission.
 boolean isCorrectPermission(PermissionsDescriptor pd)
          Return true if the passed in permission matches the one required by this StatementPermission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementPermission

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

check

public abstract void check(LanguageConnectionContext lcc,
                           java.lang.String authorizationId,
                           boolean forGrant,
                           Activation activation)
                    throws StandardException
Parameters:
lcc - LanguageConnectionContext
authorizationId - AuthorizationId
forGrant -
activation - activation for statement needing check
Throws:
StandardException - if the permission has not been granted

getPermissionDescriptor

public abstract PermissionsDescriptor getPermissionDescriptor(java.lang.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 - AuthorizationId
dd - DataDictionary
Returns:
PermissionsDescriptor The PermissionsDescriptor for the passed authorization id on this object
Throws:
StandardException

isCorrectPermission

public boolean isCorrectPermission(PermissionsDescriptor pd)
                            throws StandardException
Return true if the passed in permission matches the one required by this StatementPermission.

Throws:
StandardException

getPrivilegedObject

public PrivilegedSQLObject getPrivilegedObject(DataDictionary dd)
                                        throws StandardException
Get the privileged object associated with this permission.

Throws:
StandardException

getObjectType

public java.lang.String getObjectType()
Get the type of the privileged object.


genericCheck

public void genericCheck(LanguageConnectionContext lcc,
                         java.lang.String authorizationId,
                         boolean forGrant,
                         Activation activation,
                         java.lang.String privilegeType)
                  throws StandardException
Generic logic called by check() for USAGE and EXECUTE privileges. Throws an exception if the correct permission cannot be found.

Throws:
StandardException

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.