MySQL 8.4.0
Source Code Documentation
dynamic_privileges_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23#ifndef DYNAMIC_PRIVILEGES_IMPL_H
24#define DYNAMIC_PRIVILEGES_IMPL_H
27#include <stddef.h>
28
30
31/**
32 Interface implementation for registering and checking global dynamic
33 privileges.
34*/
36 public:
37 static DEFINE_BOOL_METHOD(register_privilege, (const char *privilege_str,
38 size_t privilege_str_len));
39
40 static DEFINE_BOOL_METHOD(unregister_privilege, (const char *privilege_str,
41 size_t privilege_str_len));
42
43 /**
44 Check if the supplied security context has the specified privilege
45 identifier granted to it.
46 @return
47 @retval true The privilege was granted.
48 @retval false Access is defined - no such privilege.
49 */
51 (Security_context_handle, const char *privilege_str,
52 size_t privilege_str_len));
53
55 (const char *priv_name, size_t priv_name_len));
56
58 (const char *priv_name, size_t priv_name_len));
59};
60bool dynamic_privilege_init(void);
61#endif /* MYSQL_SERVER_DYNAMIC_LOADER_PATH_FILTER_H */
Interface implementation for registering and checking global dynamic privileges.
Definition: dynamic_privileges_impl.h:35
static mysql_service_status_t remove_deprecated(const char *priv_name, size_t priv_name_len) noexcept
Definition: dynamic_privileges_impl.cc:228
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.
Definition: dynamic_privileges_impl.cc:141
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.
Definition: dynamic_privileges_impl.cc:189
static mysql_service_status_t add_deprecated(const char *priv_name, size_t priv_name_len) noexcept
Definition: dynamic_privileges_impl.cc:195
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.
Definition: dynamic_privileges_impl.cc:107
struct Security_context_handle_imp * Security_context_handle
Definition: dynamic_privilege.h:29
bool dynamic_privilege_init(void)
Bootstrap the dynamic privilege service by seeding it with server implementation-specific data.
Definition: dynamic_privileges_impl.cc:266
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88