MySQL 8.0.30
Source Code Documentation
dynamic_privileges_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2022, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22#ifndef DYNAMIC_PRIVILEGES_IMPL_H
23#define DYNAMIC_PRIVILEGES_IMPL_H
26#include <stddef.h>
27
29
30/**
31 Interface implementation for registering and checking global dynamic
32 privileges.
33*/
35 public:
36 static DEFINE_BOOL_METHOD(register_privilege, (const char *privilege_str,
37 size_t privilege_str_len));
38
39 static DEFINE_BOOL_METHOD(unregister_privilege, (const char *privilege_str,
40 size_t privilege_str_len));
41
42 /**
43 Check if the supplied security context has the specified privilege
44 identifier granted to it.
45 @return
46 @retval true The privilege was granted.
47 @retval false Access is defined - no such privilege.
48 */
50 (Security_context_handle, const char *privilege_str,
51 size_t privilege_str_len));
52
53 private:
54};
55bool dynamic_privilege_init(void);
56#endif /* MYSQL_SERVER_DYNAMIC_LOADER_PATH_FILTER_H */
Interface implementation for registering and checking global dynamic privileges.
Definition: dynamic_privileges_impl.h:34
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:140
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:180
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:104
struct Security_context_handle_imp * Security_context_handle
Definition: dynamic_privilege.h:28
bool dynamic_privilege_init(void)
Bootstrap the dynamic privilege service by seeding it with server implementation-specific data.
Definition: dynamic_privileges_impl.cc:190
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:128
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:87