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

Constructor & Destructor Documentation

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

Definition at line 1486 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 3951 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

3951  {
3952  const auto& currentUser = session.get_currentUser();
3953  if (!currentUser.isSuper) {
3954  throw std::runtime_error("CREATE ROLE " + get_role() +
3955  " failed. It can only be executed by super user.");
3956  }
3957  SysCatalog::instance().createRole(get_role());
3958 }
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:

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

Definition at line 1487 of file ParserNode.h.

References role.

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

Member Data Documentation

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

Definition at line 1491 of file ParserNode.h.

Referenced by get_role().

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