MySQL 8.0.39
Source Code Documentation
Roles::Role_activation Class Reference

#include <roles.h>

Public Member Functions

 Role_activation (THD *thd, Security_context *sctx, role_enum type, const List< LEX_USER > *role_list=nullptr, bool raise_error=true)
 Constructor. More...
 
 Role_activation (const Role_activation &)=delete
 
 Role_activation (Role_activation &&)=delete
 
Role_activationoperator= (const Role_activation &)=delete
 
Role_activationoperator= (Role_activation &&)=delete
 
 ~Role_activation ()
 
bool activate ()
 Activate roles for given session. More...
 

Private Member Functions

bool activate_role_none ()
 Deactivate all roles for current session. More...
 
bool activate_role_default ()
 Activate default roles for current session. More...
 
bool activate_role_all ()
 Activate all granted roles - except those specified through m_role_list. More...
 
bool activate_role_name ()
 Activate roles available through m_role_list. More...
 

Private Attributes

THDm_thd
 
Security_contextm_sctx
 
role_enum m_type
 
const List< LEX_USER > * m_role_list
 
bool m_raise_error
 
bool m_valid
 

Constructor & Destructor Documentation

◆ Role_activation() [1/3]

Roles::Role_activation::Role_activation ( THD thd,
Security_context sctx,
role_enum  type,
const List< LEX_USER > *  role_list = nullptr,
bool  raise_error = true 
)
explicit

Constructor.

Parameters
[in]thdTHD handle
[in]sctxSecurity context handle
[in]typeRole activation type
[in]role_listList of roles - depends on type
[in]raise_errorFlag to raise error

◆ Role_activation() [2/3]

Roles::Role_activation::Role_activation ( const Role_activation )
delete

◆ Role_activation() [3/3]

Roles::Role_activation::Role_activation ( Role_activation &&  )
delete

◆ ~Role_activation()

Roles::Role_activation::~Role_activation ( )
inline

Member Function Documentation

◆ activate()

bool Roles::Role_activation::activate ( )

Activate roles for given session.

Returns
status of role activation
Return values
falseSuccess
trueFailure. Error is raised.

◆ activate_role_all()

bool Roles::Role_activation::activate_role_all ( )
private

Activate all granted roles - except those specified through m_role_list.

Returns
Operation status
Return values
falseSuccess
trueError

◆ activate_role_default()

bool Roles::Role_activation::activate_role_default ( )
private

Activate default roles for current session.

Returns
Operation status
Return values
falseSuccess
trueError

◆ activate_role_name()

bool Roles::Role_activation::activate_role_name ( )
private

Activate roles available through m_role_list.

Returns
Operation status
Return values
falseSuccess
trueError

◆ activate_role_none()

bool Roles::Role_activation::activate_role_none ( )
private

Deactivate all roles for current session.

Returns
Operation status
Return values
falseSuccess
trueError

◆ operator=() [1/2]

Role_activation & Roles::Role_activation::operator= ( const Role_activation )
delete

◆ operator=() [2/2]

Role_activation & Roles::Role_activation::operator= ( Role_activation &&  )
delete

Member Data Documentation

◆ m_raise_error

bool Roles::Role_activation::m_raise_error
private

◆ m_role_list

const List<LEX_USER>* Roles::Role_activation::m_role_list
private

◆ m_sctx

Security_context* Roles::Role_activation::m_sctx
private

◆ m_thd

THD* Roles::Role_activation::m_thd
private

◆ m_type

role_enum Roles::Role_activation::m_type
private

◆ m_valid

bool Roles::Role_activation::m_valid
private

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