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

#include <ParserNode.h>

+ Inheritance diagram for Parser::DropRoleStmt:
+ Collaboration diagram for Parser::DropRoleStmt:

Public Member Functions

 DropRoleStmt (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 1438 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1440 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 3802 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

3802  {
3803  const auto& currentUser = session.get_currentUser();
3804  if (!currentUser.isSuper) {
3805  throw std::runtime_error("DROP ROLE " + get_role() +
3806  " failed. It can only be executed by super user.");
3807  }
3808  auto* rl = SysCatalog::instance().getRoleGrantee(get_role());
3809  if (!rl) {
3810  throw std::runtime_error("DROP ROLE " + get_role() +
3811  " failed because role with this name does not exist.");
3812  }
3813  SysCatalog::instance().dropRole(get_role());
3814 }
const std::string & get_role() const
Definition: ParserNode.h:1441
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:93

+ Here is the call graph for this function:

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

Definition at line 1441 of file ParserNode.h.

References role.

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

Member Data Documentation

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

Definition at line 1445 of file ParserNode.h.

Referenced by get_role().


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