OmniSciDB  dfae7c3b14
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 1484 of file ParserNode.h.

Constructor & Destructor Documentation

◆ CreateRoleStmt()

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

Definition at line 1486 of file ParserNode.h.

1486 : role(r) {}
std::unique_ptr< std::string > role
Definition: ParserNode.h:1491

Member Function Documentation

◆ execute()

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

Implements Parser::DDLStmt.

Definition at line 3939 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

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

3939  {
3940  const auto& currentUser = session.get_currentUser();
3941  if (!currentUser.isSuper) {
3942  throw std::runtime_error("CREATE ROLE " + get_role() +
3943  " failed. It can only be executed by super user.");
3944  }
3945  SysCatalog::instance().createRole(get_role());
3946 }
const std::string & get_role() const
Definition: ParserNode.h:1487
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_role()

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

Definition at line 1487 of file ParserNode.h.

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

Member Data Documentation

◆ role

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

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