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

#include <ParserNode.h>

+ Inheritance diagram for Parser::RevokeRoleStmt:
+ Collaboration diagram for Parser::RevokeRoleStmt:

Public Member Functions

 RevokeRoleStmt (std::list< std::string * > *r, std::list< std::string * > *g)
 
const std::vector< std::string > & get_roles () const
 
const std::vector< std::string > & get_grantees () 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::vector< std::string > roles
 
std::vector< std::string > grantees
 

Detailed Description

Definition at line 1670 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::RevokeRoleStmt::RevokeRoleStmt ( std::list< std::string * > *  r,
std::list< std::string * > *  g 
)
inline

Definition at line 1672 of file ParserNode.h.

References grantees, Parser::parser_slistval_to_vector(), and roles.

1672  {
1675  }
tuple r
Definition: test_fsi.py:16
void parser_slistval_to_vector(std::list< std::string * > *l, std::vector< std::string > &v)
Definition: ParserNode.h:1562
std::vector< std::string > roles
Definition: ParserNode.h:1681
std::vector< std::string > grantees
Definition: ParserNode.h:1682

+ Here is the call graph for this function:

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 5223 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser(), and OMNISCI_ROOT_USER.

Referenced by omnisci.cursor.Cursor::executemany().

5223  {
5224  const auto& currentUser = session.get_currentUser();
5225  if (!currentUser.isSuper) {
5226  throw std::runtime_error(
5227  "REVOKE failed, because it can only be executed by super user.");
5228  }
5229  if (std::find(get_grantees().begin(), get_grantees().end(), OMNISCI_ROOT_USER) !=
5230  get_grantees().end()) {
5231  throw std::runtime_error(
5232  "Request to revoke role failed because privileges can not be revoked from "
5233  "mapd "
5234  "root user.");
5235  }
5236  SysCatalog::instance().revokeRoleBatch(get_roles(), get_grantees());
5237 }
const std::vector< std::string > & get_grantees() const
Definition: ParserNode.h:1677
const std::vector< std::string > & get_roles() const
Definition: ParserNode.h:1676
const std::string OMNISCI_ROOT_USER
Definition: SysCatalog.h:60
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::vector<std::string>& Parser::RevokeRoleStmt::get_grantees ( ) const
inline

Definition at line 1677 of file ParserNode.h.

References grantees.

1677 { return grantees; }
std::vector< std::string > grantees
Definition: ParserNode.h:1682
const std::vector<std::string>& Parser::RevokeRoleStmt::get_roles ( ) const
inline

Definition at line 1676 of file ParserNode.h.

References roles.

1676 { return roles; }
std::vector< std::string > roles
Definition: ParserNode.h:1681

Member Data Documentation

std::vector<std::string> Parser::RevokeRoleStmt::grantees
private

Definition at line 1682 of file ParserNode.h.

Referenced by get_grantees(), and RevokeRoleStmt().

std::vector<std::string> Parser::RevokeRoleStmt::roles
private

Definition at line 1681 of file ParserNode.h.

Referenced by get_roles(), and RevokeRoleStmt().


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