Top Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class TablePrivilegeInfo

extends PrivilegeInfo
Class Inheritance
Imports
org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.sql.Activation, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.depend.DependencyManager, org.apache.derby.iapi.sql.dictionary.AliasDescriptor, .SchemaDescriptor, .TablePermsDescriptor, .ColPermsDescriptor, .TableDescriptor, .ViewDescriptor, .DataDictionary, .DataDescriptorGenerator, .TupleDescriptor, org.apache.derby.shared.common.reference.SQLState, java.util.List, .Iterator

Field Summary

Modifier and TypeField and Description
public static final int
private final boolean[]
private static final String[][]
private final FormatableBitSet[]
public static final int
private final List<E>
public static final int
private static final String
public static final int
public static final int
private final TableDescriptor
public static final int
public static final int
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public
TablePrivilegeInfo(TableDescriptor td, boolean[]
actionAllowed[action] is true if action is in the privilege set.
actionAllowed
,
FormatableBitSet[] columnBitSets, List<E> descriptorList)

Method Summary

Modifier and TypeMethod and Description
protected void
checkOwnership(String
authorizationId of current user
user
,
TableDescriptor
table descriptor being checked against
td
,
SchemaDescriptor
SchemaDescriptor
sd
,
DataDictionary
DataDictionary
dd
,
LanguageConnectionContext
LanguageConnectionContext
lcc
,
boolean
grant if true; revoke if false
grant
)

Determines whether a user is the owner of an object (table, function, or procedure).

private void
checkPrivileges(String
authorizationId of current user
user
,
TableDescriptor
TableDescriptor to be checked against
td
,
SchemaDescriptor
SchemaDescriptor
sd
,
DataDictionary
DataDictionary
dd
,
LanguageConnectionContext
LanguageConnectionContext
lcc
)

Determines if the privilege is grantable by this grantor for the given view.

public void
executeGrantRevoke(Activation activation, boolean
true if grant, false if revoke
grant
,
List<E>
a list of authorization ids (strings)
grantees
)

Implements abstract org.apache.derby.impl.sql.execute.PrivilegeInfo.executeGrantRevoke.

This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege

private String
getActionString(int action, boolean forGrantOption)

private String
getPermString(int action, boolean forGrantOption)

private boolean
Inherited from org.apache.derby.impl.sql.execute.PrivilegeInfo:
addWarningIfPrivilegeNotRevokedcheckOwnership

Field Detail

ACTION_COUNTback to summary
public static final int ACTION_COUNT
actionAllowedback to summary
private final boolean[] actionAllowed
actionStringback to summary
private static final String[][] actionString
columnBitSetsback to summary
private final FormatableBitSet[] columnBitSets
DELETE_ACTIONback to summary
public static final int DELETE_ACTION
descriptorListback to summary
private final List<E> descriptorList
INSERT_ACTIONback to summary
public static final int INSERT_ACTION
NOback to summary
private static final String NO
REFERENCES_ACTIONback to summary
public static final int REFERENCES_ACTION
SELECT_ACTIONback to summary
public static final int SELECT_ACTION
tdback to summary
private final TableDescriptor td
TRIGGER_ACTIONback to summary
public static final int TRIGGER_ACTION
UPDATE_ACTIONback to summary
public static final int UPDATE_ACTION
YES_WITH_GRANT_OPTIONback to summary
private static final String YES_WITH_GRANT_OPTION
YES_WITHOUT_GRANT_OPTIONback to summary
private static final String YES_WITHOUT_GRANT_OPTION

Constructor Detail

TablePrivilegeInfoback to summary
public TablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, List<E> descriptorList)
Parameters
actionAllowed:boolean[]

actionAllowed[action] is true if action is in the privilege set.

Method Detail

checkOwnershipback to summary
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:String

authorizationId of current user

td:TableDescriptor

table descriptor being checked against

sd:SchemaDescriptor

SchemaDescriptor

dd:DataDictionary

DataDictionary

lcc:LanguageConnectionContext

LanguageConnectionContext

grant:boolean

grant if true; revoke if false

Exceptions
StandardException:
if user does not own the object
checkPrivilegesback to summary
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:String

authorizationId of current user

td:TableDescriptor

TableDescriptor to be checked against

sd:SchemaDescriptor

SchemaDescriptor

dd:DataDictionary

DataDictionary

lcc:LanguageConnectionContext

LanguageConnectionContext

Exceptions
StandardException:
if user does not have permission to grant
executeGrantRevokeback to summary
public void executeGrantRevoke(Activation activation, boolean grant, List<E> grantees) throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.PrivilegeInfo.executeGrantRevoke.

This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege

Parameters
grant:boolean

true if grant, false if revoke

grantees:List<E>

a list of authorization ids (strings)

Exceptions
StandardException:
Thrown on failure
getActionStringback to summary
private String getActionString(int action, boolean forGrantOption)
getPermStringback to summary
private String getPermString(int action, boolean forGrantOption)
hasColumnPermissionsback to summary
private boolean hasColumnPermissions(int action)