OmniSciDB  1dac507f6e
 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 1424 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1426 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 3792 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

3792  {
3793  const auto& currentUser = session.get_currentUser();
3794  if (!currentUser.isSuper) {
3795  throw std::runtime_error("CREATE ROLE " + get_role() +
3796  " failed. It can only be executed by super user.");
3797  }
3798  SysCatalog::instance().createRole(get_role());
3799 }
const std::string & get_role() const
Definition: ParserNode.h:1427
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:93

+ Here is the call graph for this function:

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

Definition at line 1427 of file ParserNode.h.

References role.

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

Member Data Documentation

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

Definition at line 1431 of file ParserNode.h.

Referenced by get_role().


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