Class CreateRoleConstantAction

  • All Implemented Interfaces:
    ConstantAction

    class CreateRoleConstantAction
    extends DDLConstantAction
    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 Detail

      • roleName

        private java.lang.String roleName
    • Constructor Detail

      • CreateRoleConstantAction

        public CreateRoleConstantAction​(java.lang.String roleName)
        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 Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • knownUser

        private boolean knownUser​(java.lang.String roleName,
                                  java.lang.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