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 intprivate final boolean[]private static final String[][]private final FormatableBitSet[]static final intprivate final Liststatic final intprivate static final Stringstatic final intstatic final intprivate final TableDescriptorstatic final intstatic final intprivate static final Stringprivate static final String -
Constructor Summary
ConstructorsConstructorDescriptionTablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, List descriptorList) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckOwnership(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 voidcheckPrivileges(String user, TableDescriptor td, SchemaDescriptor sd, DataDictionary dd, LanguageConnectionContext lcc) Determines if the privilege is grantable by this grantor for the given view.voidexecuteGrantRevoke(Activation activation, boolean grant, List grantees) This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilegeprivate StringgetActionString(int action, boolean forGrantOption) private StringgetPermString(int action, boolean forGrantOption) private booleanhasColumnPermissions(int action) Methods inherited from class 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:
executeGrantRevokein 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)
-