Class TablePrivilegeInfo
java.lang.Object
org.apache.derby.impl.sql.execute.PrivilegeInfo
org.apache.derby.impl.sql.execute.TablePrivilegeInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private final boolean[]
private static final String[][]
private final FormatableBitSet[]
static final int
private final List
static final int
private static final String
static final int
static final int
private final TableDescriptor
static final int
static final int
private static final String
private static final String
-
Constructor Summary
ConstructorsConstructorDescriptionTablePrivilegeInfo
(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, List descriptorList) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkOwnership
(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
(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, List grantees) This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilegeprivate String
getActionString
(int action, boolean forGrantOption) private String
getPermString
(int action, boolean forGrantOption) private boolean
hasColumnPermissions
(int action) Methods inherited from class org.apache.derby.impl.sql.execute.PrivilegeInfo
addWarningIfPrivilegeNotRevoked, checkOwnership
-
Field Details
-
SELECT_ACTION
public static final int SELECT_ACTION- See Also:
-
DELETE_ACTION
public static final int DELETE_ACTION- See Also:
-
INSERT_ACTION
public static final int INSERT_ACTION- See Also:
-
UPDATE_ACTION
public static final int UPDATE_ACTION- See Also:
-
REFERENCES_ACTION
public static final int REFERENCES_ACTION- See Also:
-
TRIGGER_ACTION
public static final int TRIGGER_ACTION- See Also:
-
ACTION_COUNT
public static final int ACTION_COUNT- See Also:
-
YES_WITH_GRANT_OPTION
- See Also:
-
YES_WITHOUT_GRANT_OPTION
- See Also:
-
NO
- See Also:
-
actionString
-
td
-
actionAllowed
private final boolean[] actionAllowed -
columnBitSets
-
descriptorList
-
-
Constructor Details
-
TablePrivilegeInfo
public TablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, List descriptorList) - Parameters:
actionAllowed
- actionAllowed[action] is true if action is in the privilege set.
-
-
Method Details
-
checkOwnership
protected void checkOwnership(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(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, List grantees) throws StandardException This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege- Specified by:
executeGrantRevoke
in classPrivilegeInfo
- Parameters:
activation
-grant
- true if grant, false if revokegrantees
- a list of authorization ids (strings)- Throws:
StandardException
- Thrown on failure
-
getPermString
-
getActionString
-
hasColumnPermissions
private boolean hasColumnPermissions(int action)
-