org.apache.derby.impl.sql.execute
Class TablePrivilegeInfo

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.PrivilegeInfo
      extended by org.apache.derby.impl.sql.execute.TablePrivilegeInfo

public class TablePrivilegeInfo
extends PrivilegeInfo


Field Summary
static int ACTION_COUNT
           
private  boolean[] actionAllowed
           
private static java.lang.String[][] actionString
           
private  FormatableBitSet[] columnBitSets
           
static int DELETE_ACTION
           
private  java.util.List descriptorList
           
static int INSERT_ACTION
           
private static java.lang.String NO
           
static int REFERENCES_ACTION
           
static int SELECT_ACTION
           
private  TableDescriptor td
           
static int TRIGGER_ACTION
           
static int UPDATE_ACTION
           
private static java.lang.String YES_WITH_GRANT_OPTION
           
private static java.lang.String YES_WITHOUT_GRANT_OPTION
           
 
Constructor Summary
TablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, java.util.List descriptorList)
           
 
Method Summary
protected  void checkOwnership(java.lang.String user, TableDescriptor td, SchemaDescriptor sd, DataDictionary dd, LanguageConnectionContext lcc, boolean grant)
          Determines whether a user is the owner of an object (table, function, or procedure).
private  void checkPrivileges(java.lang.String user, TableDescriptor td, SchemaDescriptor sd, DataDictionary dd, LanguageConnectionContext lcc)
          Determines if the privilege is grantable by this grantor for the given view.
 void executeGrantRevoke(Activation activation, boolean grant, java.util.List grantees)
          This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege
private  java.lang.String getActionString(int action, boolean forGrantOption)
           
private  java.lang.String getPermString(int action, boolean forGrantOption)
           
private  boolean hasColumnPermissions(int action)
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.PrivilegeInfo
addWarningIfPrivilegeNotRevoked, checkOwnership
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECT_ACTION

public static final int SELECT_ACTION
See Also:
Constant Field Values

DELETE_ACTION

public static final int DELETE_ACTION
See Also:
Constant Field Values

INSERT_ACTION

public static final int INSERT_ACTION
See Also:
Constant Field Values

UPDATE_ACTION

public static final int UPDATE_ACTION
See Also:
Constant Field Values

REFERENCES_ACTION

public static final int REFERENCES_ACTION
See Also:
Constant Field Values

TRIGGER_ACTION

public static final int TRIGGER_ACTION
See Also:
Constant Field Values

ACTION_COUNT

public static final int ACTION_COUNT
See Also:
Constant Field Values

YES_WITH_GRANT_OPTION

private static final java.lang.String YES_WITH_GRANT_OPTION
See Also:
Constant Field Values

YES_WITHOUT_GRANT_OPTION

private static final java.lang.String YES_WITHOUT_GRANT_OPTION
See Also:
Constant Field Values

NO

private static final java.lang.String NO
See Also:
Constant Field Values

actionString

private static final java.lang.String[][] actionString

td

private TableDescriptor td

actionAllowed

private boolean[] actionAllowed

columnBitSets

private FormatableBitSet[] columnBitSets

descriptorList

private java.util.List descriptorList
Constructor Detail

TablePrivilegeInfo

public TablePrivilegeInfo(TableDescriptor td,
                          boolean[] actionAllowed,
                          FormatableBitSet[] columnBitSets,
                          java.util.List descriptorList)
Parameters:
actionAllowed - actionAllowed[action] is true if action is in the privilege set.
Method Detail

checkOwnership

protected void checkOwnership(java.lang.String user,
                              TableDescriptor td,
                              SchemaDescriptor sd,
                              DataDictionary dd,
                              LanguageConnectionContext lcc,
                              boolean grant)
                       throws StandardException
Determines whether a user is the owner of an object (table, function, or procedure). Note that the database creator can access database objects without needing to be their owner.

Parameters:
user - authorizationId of current user
td - table descriptor being checked against
sd - SchemaDescriptor
dd - DataDictionary
lcc - LanguageConnectionContext
grant - grant if true; revoke if false
Throws:
StandardException - if user does not own the object

checkPrivileges

private void checkPrivileges(java.lang.String user,
                             TableDescriptor td,
                             SchemaDescriptor sd,
                             DataDictionary dd,
                             LanguageConnectionContext lcc)
                      throws StandardException
Determines if the privilege is grantable by this grantor for the given view. Note that the database owner can access database objects without needing to be their owner. This method should only be called if it is a GRANT.

Parameters:
user - authorizationId of current user
td - TableDescriptor to be checked against
sd - SchemaDescriptor
dd - DataDictionary
lcc - LanguageConnectionContext
Throws:
StandardException - if user does not have permission to grant

executeGrantRevoke

public void executeGrantRevoke(Activation activation,
                               boolean grant,
                               java.util.List grantees)
                        throws StandardException
This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege

Specified by:
executeGrantRevoke in class PrivilegeInfo
Parameters:
activation -
grant - true if grant, false if revoke
grantees - a list of authorization ids (strings)
Throws:
StandardException - Thrown on failure

getPermString

private java.lang.String getPermString(int action,
                                       boolean forGrantOption)

getActionString

private java.lang.String getActionString(int action,
                                         boolean forGrantOption)

hasColumnPermissions

private boolean hasColumnPermissions(int action)

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.