OmniSciDB  0fdbebe030
 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 1496 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1498 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 3756 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser().

3756  {
3757  const auto& currentUser = session.get_currentUser();
3758  if (!currentUser.isSuper) {
3759  throw std::runtime_error("DROP ROLE " + get_role() +
3760  " failed. It can only be executed by super user.");
3761  }
3762  auto* rl = SysCatalog::instance().getRoleGrantee(get_role());
3763  if (!rl) {
3764  throw std::runtime_error("DROP ROLE " + get_role() +
3765  " failed because role with this name does not exist.");
3766  }
3767  SysCatalog::instance().dropRole(get_role());
3768 }
const std::string & get_role() const
Definition: ParserNode.h:1499
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:79

+ Here is the call graph for this function:

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

Definition at line 1499 of file ParserNode.h.

References role.

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

Member Data Documentation

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

Definition at line 1503 of file ParserNode.h.

Referenced by get_role().


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