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

pack-priv Class GrantRoleConstantAction

extends DDLConstantAction
Class Inheritance
Imports
java.util.Iterator, .List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, .Authorizer, org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator, .RoleGrantDescriptor, .DataDictionary, .RoleClosureIterator, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.sanity.SanityManager

This class performs actions that are ALWAYS performed for a GRANT role statement at execution time. Descriptors corresponding to the grants are stored in the SYS.SYSROLES table, along with the role definitions, cf CreateRoleConstantAction.

Field Summary

Modifier and TypeField and Description
private List<E>
private List<E>
private final boolean

Constructor Summary

AccessConstructor and Description
public
GrantRoleConstantAction(List<E>
List of the names of the roles being granted
roleNames
,
List<E>
List of the authorization ids granted to role
grantees
)

Make the ConstantAction for a CREATE ROLE statement.

Method Summary

Modifier and TypeMethod and Description
private void
checkCircularity(String
The role about to be granted
role
,
String
The role to which role is to be granted
grantee
,
String
Who does the granting
grantor
,
TransactionController tc, DataDictionary dd)

Check that allowing this grant to go ahead does nto create a circularity in the GRANT role relation graph, cf. Section 12.5, Syntax rule 1 of ISO/IEC 9075-2 2003.

public void
executeConstantAction(Activation
The execution environment for this constant action.
activation
)

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for GRANT role.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.impl.sql.execute.DDLConstantAction:
addColumnDependenciesadjustUDTDependenciesadjustUDTDependenciesconstructToStringgetAndCheckSchemaDescriptorgetSchemaDescriptorForCreatelockTableForDDLstoreConstraintDependenciesOnPrivilegesstoreViewTriggerDependenciesOnPrivileges

Field Detail

granteesback to summary
private List<E> grantees
roleNamesback to summary
private List<E> roleNames
withAdminOptionback to summary
private final boolean withAdminOption

Constructor Detail

GrantRoleConstantActionback to summary
public GrantRoleConstantAction(List<E> roleNames, List<E> grantees)

Make the ConstantAction for a CREATE ROLE statement. When executed, will create a role by the given name.

Parameters
roleNames:List<E>

List of the names of the roles being granted

grantees:List<E>

List of the authorization ids granted to role

Method Detail

checkCircularityback to summary
private void checkCircularity(String role, String grantee, String grantor, TransactionController tc, DataDictionary dd) throws StandardException

Check that allowing this grant to go ahead does nto create a circularity in the GRANT role relation graph, cf. Section 12.5, Syntax rule 1 of ISO/IEC 9075-2 2003.

Parameters
role:String

The role about to be granted

grantee:String

The role to which role is to be granted

grantor:String

Who does the granting

Exceptions
StandardException:
normal error policy. Throws AUTH_ROLE_GRANT_CIRCULARITY if a circularity is detected.
executeConstantActionback to summary
public void executeConstantAction(Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for GRANT role.

Parameters
activation:Activation

Doc from org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

The execution environment for this constant action.

Exceptions
StandardException:
Thrown on failure
See Also
ConstantAction#executeConstantAction
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object