org.apache.derby.impl.sql.execute
Class TablePrivilegeInfo
java.lang.Object
org.apache.derby.impl.sql.execute.PrivilegeInfo
org.apache.derby.impl.sql.execute.TablePrivilegeInfo
public class TablePrivilegeInfo
- extends PrivilegeInfo
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.
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 usertd
- table descriptor being checked againstsd
- SchemaDescriptordd
- DataDictionarylcc
- LanguageConnectionContextgrant
- 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 usertd
- TableDescriptor to be checked againstsd
- SchemaDescriptordd
- DataDictionarylcc
- 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 revokegrantees
- 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)
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.