OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::CreateRoleStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::CreateRoleStmt:
+ Collaboration diagram for Parser::CreateRoleStmt:

Public Member Functions

 CreateRoleStmt (std::string *r)
const std::string & get_role () const
void execute (const Catalog_Namespace::SessionInfo &session) override
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
- Public Member Functions inherited from Parser::Node
virtual ~Node ()

Private Attributes

std::unique_ptr< std::string > role

Detailed Description

Definition at line 1538 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::CreateRoleStmt::CreateRoleStmt ( std::string *  r)

Definition at line 1540 of file ParserNode.h.

1540 : role(r) {}
tuple r
std::unique_ptr< std::string > role
Definition: ParserNode.h:1545

Member Function Documentation

void Parser::CreateRoleStmt::execute ( const Catalog_Namespace::SessionInfo session)

Implements Parser::DDLStmt.

Definition at line 4861 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

Referenced by omnisci.cursor.Cursor::executemany().

4861  {
4862  const auto& currentUser = session.get_currentUser();
4863  if (!currentUser.isSuper) {
4864  throw std::runtime_error("CREATE ROLE " + get_role() +
4865  " failed. It can only be executed by super user.");
4866  }
4867  SysCatalog::instance().createRole(get_role());
4868 }
const std::string & get_role() const
Definition: ParserNode.h:1541
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string& Parser::CreateRoleStmt::get_role ( ) const

Definition at line 1541 of file ParserNode.h.

References role.

1541 { return *role; }
std::unique_ptr< std::string > role
Definition: ParserNode.h:1545

Member Data Documentation

std::unique_ptr<std::string> Parser::CreateRoleStmt::role

The documentation for this class was generated from the following files: