OmniSciDB  04ee39c94c
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 1323 of file ParserNode.h.

Constructor & Destructor Documentation

◆ CreateRoleStmt()

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

Definition at line 1325 of file ParserNode.h.

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

Member Function Documentation

◆ execute()

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

Implements Parser::DDLStmt.

Definition at line 3713 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

3713  {
3714  const auto& currentUser = session.get_currentUser();
3715  if (!currentUser.isSuper) {
3716  throw std::runtime_error("CREATE ROLE " + get_role() +
3717  " failed. It can only be executed by super user.");
3718  }
3719  SysCatalog::instance().createRole(get_role());
3720 }
const std::string & get_role() const
Definition: ParserNode.h:1326
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:93
+ Here is the call graph for this function:

◆ get_role()

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

Definition at line 1326 of file ParserNode.h.

References session.

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

Member Data Documentation

◆ role

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

Definition at line 1330 of file ParserNode.h.


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