MySQL  8.0.17
Source Code Documentation
dynamic_privileges_impl.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2 
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6 
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 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  /**
40  Unregister a previously registered privilege object identifier so that it no
41  longer can be used in GRANT statements.
42  @param privilege_str Privilege object ID
43  @param privilege_str_len The length of the string (not including \0)
44  @return Error state
45  @retval true Operation was not successful
46  @retval false Success
47  */
48  static DEFINE_BOOL_METHOD(unregister_privilege, (const char *privilege_str,
49  size_t privilege_str_len));
50 
51  /**
52  Check if the supplied security context has the specified privilege
53  identifier granted to it.
54  @return
55  @retval true The privilege was granted.
56  @retval false Access is defined - no such privilege.
57  */
59  (Security_context_handle, const char *privilege_str,
60  size_t privilege_str_len));
61 
62  private:
63 };
64 bool dynamic_privilege_init(void);
65 #endif /* MYSQL_SERVER_DYNAMIC_LOADER_PATH_FILTER_H */
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:164
#define DEFINE_BOOL_METHOD(name, args)
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:101
#define DEFINE_SERVICE_HANDLE(name)
Interface implementation for registering and checking global dynamic privileges.
Definition: dynamic_privileges_impl.h:34
struct Security_context_handle_imp * Security_context_handle
Definition: dynamic_privilege.h:28
bool dynamic_privilege_init(void)
Boostrap the dynamic privilege service by seeding it with server implementation specific data...
Definition: dynamic_privileges_impl.cc:174
Specifies macros to define Service Implementations.
static mysql_service_status_t unregister_privilege(const char *privilege_str, size_t privilege_str_len) noexcept
Unregister a previously registered privilege object identifier so that it no longer can be used in GR...
Definition: dynamic_privileges_impl.cc:135