Class TablePrivilegeInfo
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.PrivilegeInfo
-
- org.apache.derby.impl.sql.execute.TablePrivilegeInfo
-
public class TablePrivilegeInfo extends PrivilegeInfo
-
-
Field Summary
Fields Modifier and Type Field Description static intACTION_COUNTprivate boolean[]actionAllowedprivate static java.lang.String[][]actionStringprivate FormatableBitSet[]columnBitSetsstatic intDELETE_ACTIONprivate java.util.ListdescriptorListstatic intINSERT_ACTIONprivate static java.lang.StringNOstatic intREFERENCES_ACTIONstatic intSELECT_ACTIONprivate TableDescriptortdstatic intTRIGGER_ACTIONstatic intUPDATE_ACTIONprivate static java.lang.StringYES_WITH_GRANT_OPTIONprivate static java.lang.StringYES_WITHOUT_GRANT_OPTION
-
Constructor Summary
Constructors Constructor Description TablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, java.util.List descriptorList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckOwnership(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 voidcheckPrivileges(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.voidexecuteGrantRevoke(Activation activation, boolean grant, java.util.List grantees)This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilegeprivate java.lang.StringgetActionString(int action, boolean forGrantOption)private java.lang.StringgetPermString(int action, boolean forGrantOption)private booleanhasColumnPermissions(int action)-
Methods inherited from class org.apache.derby.impl.sql.execute.PrivilegeInfo
addWarningIfPrivilegeNotRevoked, checkOwnership
-
-
-
-
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 final TableDescriptor td
-
actionAllowed
private final boolean[] actionAllowed
-
columnBitSets
private final FormatableBitSet[] columnBitSets
-
descriptorList
private final 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 StandardExceptionDetermines 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 StandardExceptionDetermines 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:
executeGrantRevokein classPrivilegeInfo- 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)
-
-