MySQL 8.0.40
Source Code Documentation
dynamic_privilege_services_impl Class Reference

Interface implementation for registering and checking global dynamic privileges. More...

#include <dynamic_privileges_impl.h>

Static Public Member Functions

static mysql_service_status_t register_privilege (const char *privilege_str, size_t privilege_str_len) noexcept
 Register a privilege identifiers in the list of known identifiers. More...
 
static mysql_service_status_t unregister_privilege (const char *privilege_str, size_t privilege_str_len) noexcept
 Unregister a privilege identifiers in the list of known identifiers. More...
 
static mysql_service_status_t has_global_grant (Security_context_handle, const char *privilege_str, size_t privilege_str_len) noexcept
 Check if the supplied security context has the specified privilege identifier granted to it. More...
 

Detailed Description

Interface implementation for registering and checking global dynamic privileges.

Member Function Documentation

◆ has_global_grant()

mysql_service_status_t dynamic_privilege_services_impl::has_global_grant ( Security_context_handle  handle,
const char *  privilege_str,
size_t  privilege_str_len 
)
staticnoexcept

Check if the supplied security context has the specified privilege identifier granted to it.

Checks if a user has a specified privilege ID granted to it.

Returns
Return values
trueThe privilege was granted.
falseAccess is defined - no such privilege.
Parameters
handleThe active security context of the user to be checked.
privilege_strThe privilege identifier string
privilege_str_lenThe length of the identifier string
Returns
Success state
true The user has the grant
false The user hasn't the grant

◆ register_privilege()

mysql_service_status_t dynamic_privilege_services_impl::register_privilege ( const char *  privilege_str,
size_t  privilege_str_len 
)
staticnoexcept

Register a privilege identifiers in the list of known identifiers.

This enable the SQL syntax to recognize the identifier as a valid token.

Parameters
privilege_strThe privilege identifier string
privilege_str_lenThe length of the identifier string
Note
This function acquires the THD from the current_thd
Returns
Error flag
true The privilege ID couldn't be inserted.
false The privilege ID was successfully registered.

◆ unregister_privilege()

mysql_service_status_t dynamic_privilege_services_impl::unregister_privilege ( const char *  privilege_str,
size_t  privilege_str_len 
)
staticnoexcept

Unregister a privilege identifiers in the list of known identifiers.

This disables the SQL syntax from recognizing the identifier as a valid token.

Parameters
privilege_strThe privilege identifier string
privilege_str_lenThe length of the identifier string
Note
This function acquires the THD from the current_thd
Returns
Error flag
true The privilege ID wasn't in the list or remove failed.
false The privilege ID was successfully unregistered.

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