Class CreateRoleConstantAction
java.lang.Object
org.apache.derby.impl.sql.execute.DDLConstantAction
org.apache.derby.impl.sql.execute.CreateRoleConstantAction
- All Implemented Interfaces:
ConstantAction
This class performs actions that are ALWAYS performed for a
CREATE ROLE statement at execution time.
These SQL objects are stored in the SYS.SYSROLES table.
-
Field Summary
FieldsFields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
WHEN_MATCHED_THEN_DELETE, WHEN_MATCHED_THEN_UPDATE, WHEN_NOT_MATCHED_THEN_INSERT
-
Constructor Summary
ConstructorsConstructorDescriptionCreateRoleConstantAction
(String roleName) Make the ConstantAction for a CREATE ROLE statement. -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeConstantAction
(Activation activation) This is the guts of the Execution-time logic for CREATE ROLE.private boolean
knownUser
(String roleName, String currentUser, LanguageConnectionContext lcc, DataDictionary dd, TransactionController tc) Heuristically, try to determine is a proposed role identifier is already known to Derby as a user name.toString()
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges
-
Field Details
-
roleName
-
-
Constructor Details
-
CreateRoleConstantAction
Make the ConstantAction for a CREATE ROLE statement. When executed, will create a role by the given name.- Parameters:
roleName
- The name of the role being created
-
-
Method Details
-
executeConstantAction
This is the guts of the Execution-time logic for CREATE ROLE.- Parameters:
activation
- The execution environment for this constant action.- Throws:
StandardException
- Thrown on failure- See Also:
-
toString
-
knownUser
private boolean knownUser(String roleName, String currentUser, LanguageConnectionContext lcc, DataDictionary dd, TransactionController tc) throws StandardException Heuristically, try to determine is a proposed role identifier is already known to Derby as a user name. Method: If BUILTIN authentication is used, check if there is such a user. If external authentication is used, we lose. If there turns out to be collision, and we can't detect it here, we should block such a user from connecting (FIXME), since there is now a role with that name.- Throws:
StandardException
-