MySQL 8.3.0
Source Code Documentation
Restrictions_aggregator_factory Class Reference

Factory class that solely creates an object of type Restrictions_aggregator. More...

#include <partial_revokes.h>

Static Public Member Functions

static std::unique_ptr< Restrictions_aggregatorcreate (THD *thd, const ACL_USER *acl_user, const char *db, const ulong rights, bool is_grant_revoke_all_on_db)
 A factory method that creates objects from Restrictions_aggregator hierarchy. More...
 
static std::unique_ptr< Restrictions_aggregatorcreate (const Auth_id &grantor, const Auth_id &grantee, const ulong grantor_access, const ulong grantee_access, const DB_restrictions &grantor_restrictions, const DB_restrictions &grantee_restrictions, const ulong required_access, Db_access_map *db_map)
 

Static Private Member Functions

static Auth_id fetch_grantor (const Security_context *sctx)
 Returns the grantor user name and host id. More...
 
static Auth_id fetch_grantee (const ACL_USER *acl_user)
 Returns the grantee's user name and host info. More...
 
static ulong fetch_grantor_db_access (THD *thd, const char *db)
 Returns the privileges granted on the DB to the grantor. More...
 
static ulong fetch_grantee_db_access (THD *thd, const ACL_USER *acl_user, const char *db)
 Returns the privileges granted on the DB to the grantee. More...
 
static void fetch_grantor_access (const Security_context *sctx, const char *db, ulong &global_access, Restrictions &restrictions)
 Returns the privileges and restrictions: More...
 
static void fetch_grantee_access (const ACL_USER *grantee, ulong &access, Restrictions &restrictions)
 

Detailed Description

Factory class that solely creates an object of type Restrictions_aggregator.

  • The concrete implementations of Restrictions_aggregator cannot be created directly since their constructors are private. This class is declared as friend in those concrete implementations.
  • It also records the CURRENT_USER in the binlog so that partial_revokes can be executed on the replica with context of current user

Member Function Documentation

◆ create() [1/2]

std::unique_ptr< Restrictions_aggregator > Restrictions_aggregator_factory::create ( const Auth_id grantor,
const Auth_id grantee,
const ulong  grantor_access,
const ulong  grantee_access,
const DB_restrictions grantor_restrictions,
const DB_restrictions grantee_restrictions,
const ulong  required_access,
Db_access_map db_map 
)
static

◆ create() [2/2]

std::unique_ptr< Restrictions_aggregator > Restrictions_aggregator_factory::create ( THD thd,
const ACL_USER acl_user,
const char *  db,
const ulong  rights,
bool  is_grant_revoke_all_on_db 
)
static

A factory method that creates objects from Restrictions_aggregator hierarchy.

Creates an object if –partial_revokes system variable is ON. It also records the CURRENT_USER in the binlog so that partial_revokes can be executed on slave with context of current user

Parameters
[in,out]thdThread handle
[in]acl_userGrantee's info from ACL Cache
[in]dbDatabase name if it is DB level operation
[in]rightsaccess specified in the SQL statement
[in]is_grant_revoke_all_on_dbflag that indicates if the REVOKE/GRANT ALL was executed on a DB
Returns
A restriction aggregator object
Return values
nullptrif partial_revokes system variable is OFF

◆ fetch_grantee()

Auth_id Restrictions_aggregator_factory::fetch_grantee ( const ACL_USER acl_user)
staticprivate

Returns the grantee's user name and host info.

Parameters
[in]acl_useruser handle from ACL_Cache
Returns
Grantee's user name and host info

◆ fetch_grantee_access()

void Restrictions_aggregator_factory::fetch_grantee_access ( const ACL_USER grantee,
ulong &  access,
Restrictions restrictions 
)
staticprivate

◆ fetch_grantee_db_access()

ulong Restrictions_aggregator_factory::fetch_grantee_db_access ( THD thd,
const ACL_USER acl_user,
const char *  db 
)
staticprivate

Returns the privileges granted on the DB to the grantee.

Parameters
[in,out]thdTHD handle
[in]acl_useruser handle from ACL_Cache
[in]dbDatabase name for which privileges to be fetched.
Returns
privilege access to the grantee on the specified database

◆ fetch_grantor()

Auth_id Restrictions_aggregator_factory::fetch_grantor ( const Security_context sctx)
staticprivate

Returns the grantor user name and host id.

Parameters
[in]sctxSecurity context
Returns
Grantor's user name and host info

◆ fetch_grantor_access()

void Restrictions_aggregator_factory::fetch_grantor_access ( const Security_context sctx,
const char *  db,
ulong &  global_access,
Restrictions restrictions 
)
staticprivate

Returns the privileges and restrictions:

Parameters
[in]sctxsecurity context of current user
[in]dbDatabase name for which privileges to be fetched.
[out]global_accessfetch grantor's global access
[out]restrictionsfetch grantor's restrictions

◆ fetch_grantor_db_access()

ulong Restrictions_aggregator_factory::fetch_grantor_db_access ( THD thd,
const char *  db 
)
staticprivate

Returns the privileges granted on the DB to the grantor.

Parameters
[in]thdThread handle
[in]dbDatabase name for which privileges to be fetched.
Returns
privilege access to the grantor on the specified database

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