OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SysCatalog.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
29 #ifndef SYS_CATALOG_H
30 #define SYS_CATALOG_H
31 
32 #include <atomic>
33 #include <cstdint>
34 #include <ctime>
35 #include <limits>
36 #include <list>
37 #include <map>
38 #include <mutex>
39 #include <string>
40 #include <unordered_map>
41 #include <utility>
42 #include <vector>
43 
44 #include "Grantee.h"
45 #include "ObjectRoleDescriptor.h"
46 #include "PkiServer.h"
47 
48 #include "../DataMgr/DataMgr.h"
49 #include "../SqliteConnector/SqliteConnector.h"
50 #include "LeafHostInfo.h"
51 
52 #include "../Calcite/Calcite.h"
53 #include "../Shared/mapd_shared_mutex.h"
54 
55 const std::string OMNISCI_SYSTEM_CATALOG = "omnisci_system_catalog";
56 const std::string OMNISCI_DEFAULT_DB = "omnisci";
57 const std::string OMNISCI_ROOT_USER = "admin";
58 const int OMNISCI_ROOT_USER_ID = 0;
59 const std::string OMNISCI_ROOT_USER_ID_STR = "0";
60 const std::string OMNISCI_ROOT_PASSWD_DEFAULT = "HyperInteractive";
61 
62 class Calcite;
63 
64 namespace Catalog_Namespace {
65 
66 /*
67  * @type UserMetadata
68  * @brief metadata for a db user
69  */
70 struct UserMetadata {
71  UserMetadata(int32_t u,
72  const std::string& n,
73  const std::string& p,
74  bool s,
75  int32_t d,
76  bool l)
77  : userId(u)
78  , userName(n)
79  , passwd_hash(p)
80  , isSuper(s)
81  , defaultDbId(d)
82  , can_login(l) {}
84  UserMetadata(UserMetadata const& user_meta)
85  : UserMetadata(user_meta.userId,
86  user_meta.userName,
87  user_meta.passwd_hash,
88  user_meta.isSuper.load(),
89  user_meta.defaultDbId,
90  user_meta.can_login) {}
91  int32_t userId;
92  std::string userName;
93  std::string passwd_hash;
94  std::atomic<bool> isSuper{false};
95  int32_t defaultDbId;
96  bool can_login{true};
97 };
98 
99 /*
100  * @type DBMetadata
101  * @brief metadata for a database
102  */
103 struct DBMetadata {
104  DBMetadata() : dbId(0), dbOwner(0) {}
105  int32_t dbId;
106  std::string dbName;
107  int32_t dbOwner;
108 };
109 
110 /*
111  * @type DBSummary
112  * @brief summary info for a database
113  */
114 struct DBSummary {
115  std::string dbName;
116  std::string dbOwnerName;
117 };
118 using DBSummaryList = std::list<DBSummary>;
119 
121  public:
122  CommonFileOperations(std::string const& base_path) : base_path_(base_path) {}
123 
124  inline void removeCatalogByFullPath(std::string const& full_path);
125  inline void removeCatalogByName(std::string const& name);
126  inline auto duplicateAndRenameCatalog(std::string const& current_name,
127  std::string const& new_name);
128  inline auto assembleCatalogName(std::string const& name);
129 
130  private:
131  std::string const& base_path_;
132 };
133 
134 /*
135  * @type SysCatalog
136  * @brief class for the system-wide catalog, currently containing user and database
137  * metadata
138  */
140  public:
141  void init(const std::string& basePath,
142  std::shared_ptr<Data_Namespace::DataMgr> dataMgr,
143  const AuthMetadata& authMetadata,
144  std::shared_ptr<Calcite> calcite,
145  bool is_new_db,
146  bool aggregator,
147  const std::vector<LeafHostInfo>& string_dict_hosts);
148 
154  std::shared_ptr<Catalog> login(std::string& db,
155  std::string& username,
156  const std::string& password,
157  UserMetadata& user_meta,
158  bool check_password = true);
159  std::shared_ptr<Catalog> switchDatabase(std::string& dbname,
160  const std::string& username);
161  void createUser(const std::string& name,
162  const std::string& passwd,
163  bool issuper,
164  const std::string& dbname,
165  bool can_login);
166  void dropUser(const std::string& name);
167  void alterUser(const int32_t userid,
168  const std::string* passwd,
169  bool* issuper,
170  const std::string* dbname,
171  bool* can_login);
172  void renameUser(std::string const& old_name, std::string const& new_name);
173  void createDatabase(const std::string& dbname, int owner);
174  void renameDatabase(std::string const& old_name, std::string const& new_name);
175  void dropDatabase(const DBMetadata& db);
176  bool getMetadataForUser(const std::string& name, UserMetadata& user);
177  bool getMetadataForUserById(const int32_t idIn, UserMetadata& user);
178  bool checkPasswordForUser(const std::string& passwd,
179  std::string& name,
180  UserMetadata& user);
181  void getMetadataWithDefaultDB(std::string& dbname,
182  const std::string& username,
184  UserMetadata& user_meta);
185  bool getMetadataForDB(const std::string& name, DBMetadata& db);
186  bool getMetadataForDBById(const int32_t idIn, DBMetadata& db);
188  Calcite& getCalciteMgr() const { return *calciteMgr_; }
189  const std::string& getBasePath() const { return basePath_; }
191  std::list<DBMetadata> getAllDBMetadata();
192  std::list<UserMetadata> getAllUserMetadata();
196  std::list<UserMetadata> getAllUserMetadata(const int64_t dbId);
198  void createDBObject(const UserMetadata& user,
199  const std::string& objectName,
201  const Catalog_Namespace::Catalog& catalog,
202  int32_t objectId = -1);
212  void renameDBObject(const std::string& objectName,
213  const std::string& newName,
215  int32_t objectId,
216  const Catalog_Namespace::Catalog& catalog);
217  void grantDBObjectPrivileges(const std::string& grantee,
218  const DBObject& object,
219  const Catalog_Namespace::Catalog& catalog);
220  void grantDBObjectPrivilegesBatch(const std::vector<std::string>& grantees,
221  const std::vector<DBObject>& objects,
222  const Catalog_Namespace::Catalog& catalog);
223  void revokeDBObjectPrivileges(const std::string& grantee,
224  const DBObject& object,
225  const Catalog_Namespace::Catalog& catalog);
226  void revokeDBObjectPrivilegesBatch(const std::vector<std::string>& grantees,
227  const std::vector<DBObject>& objects,
228  const Catalog_Namespace::Catalog& catalog);
229  void revokeDBObjectPrivilegesFromAll(DBObject object, Catalog* catalog);
231  void revokeDBObjectPrivilegesFromAllBatch(std::vector<DBObject>& objects,
232  Catalog* catalog);
233  void revokeDBObjectPrivilegesFromAllBatch_unsafe(std::vector<DBObject>& objects,
234  Catalog* catalog);
235  void getDBObjectPrivileges(const std::string& granteeName,
236  DBObject& object,
237  const Catalog_Namespace::Catalog& catalog) const;
238  bool verifyDBObjectOwnership(const UserMetadata& user,
239  DBObject object,
240  const Catalog_Namespace::Catalog& catalog);
250  void changeDBObjectOwnership(const UserMetadata& new_owner,
251  const UserMetadata& previous_owner,
252  DBObject object,
253  const Catalog_Namespace::Catalog& catalog,
254  bool revoke_privileges = true);
255  void createRole(const std::string& roleName, const bool& userPrivateRole = false);
256  void dropRole(const std::string& roleName);
257  void grantRoleBatch(const std::vector<std::string>& roles,
258  const std::vector<std::string>& grantees);
259  void grantRole(const std::string& role, const std::string& grantee);
260  void revokeRoleBatch(const std::vector<std::string>& roles,
261  const std::vector<std::string>& grantees);
262  void revokeRole(const std::string& role, const std::string& grantee);
263  // check if the user has any permissions on all the given objects
264  bool hasAnyPrivileges(const UserMetadata& user, std::vector<DBObject>& privObjects);
265  // check if the user has the requested permissions on all the given objects
266  bool checkPrivileges(const UserMetadata& user,
267  const std::vector<DBObject>& privObjects) const;
268  bool checkPrivileges(const std::string& userName,
269  const std::vector<DBObject>& privObjects) const;
270  Grantee* getGrantee(const std::string& name) const;
271  Role* getRoleGrantee(const std::string& name) const;
272  User* getUserGrantee(const std::string& name) const;
273  std::vector<ObjectRoleDescriptor*> getMetadataForObject(int32_t dbId,
274  int32_t dbType,
275  int32_t objectId) const;
276  bool isRoleGrantedToGrantee(const std::string& granteeName,
277  const std::string& roleName,
278  bool only_direct) const;
279  std::vector<std::string> getRoles(bool userPrivateRole,
280  bool isSuper,
281  const std::string& userName);
282  std::vector<std::string> getRoles(const std::string& userName, const int32_t dbId);
283  void revokeDashboardSystemRole(const std::string roleName,
284  const std::vector<std::string> grantees);
285  bool isAggregator() const { return aggregator_; }
286  static SysCatalog& instance() {
287  static SysCatalog sys_cat{};
288  return sys_cat;
289  }
290 
291  void populateRoleDbObjects(const std::vector<DBObject>& objects);
292  std::string name() const { return OMNISCI_DEFAULT_DB; }
295  void syncUserWithRemoteProvider(const std::string& user_name,
296  std::vector<std::string> idp_roles,
297  bool* issuper);
298  std::unordered_map<std::string, std::vector<std::string>> getGranteesOfSharedDashboards(
299  const std::vector<std::string>& dashboard_ids);
300  void check_for_session_encryption(const std::string& pki_cert, std::string& session);
301  std::vector<std::shared_ptr<Catalog>> getCatalogsForAllDbs();
302 
303  private:
304  using GranteeMap = std::map<std::string, Grantee*>;
305  using ObjectRoleDescriptorMap = std::multimap<std::string, ObjectRoleDescriptor*>;
306 
309  , aggregator_(false)
310  , sqliteMutex_()
311  , sharedMutex_()
312  , thread_holding_sqlite_lock(std::thread::id())
313  , thread_holding_write_lock(std::thread::id()) {}
314  virtual ~SysCatalog();
315 
316  void initDB();
317  void buildRoleMap();
318  void buildUserRoleMap();
322  void createUserRoles();
323  void addAdminUserRole();
324  void migratePrivileges();
325  void migratePrivileged_old();
326  void updateUserSchema();
331  void loginImpl(std::string& username,
332  const std::string& password,
333  UserMetadata& user_meta);
334  bool checkPasswordForUserImpl(const std::string& passwd,
335  std::string& name,
336  UserMetadata& user);
337 
338  // Here go functions not wrapped into transactions (necessary for nested calls)
339  void grantDefaultPrivilegesToRole_unsafe(const std::string& name, bool issuper);
340  void createRole_unsafe(const std::string& roleName, const bool userPrivateRole = false);
341  void dropRole_unsafe(const std::string& roleName);
342  void grantRoleBatch_unsafe(const std::vector<std::string>& roles,
343  const std::vector<std::string>& grantees);
344  void grantRole_unsafe(const std::string& roleName, const std::string& granteeName);
345  void revokeRoleBatch_unsafe(const std::vector<std::string>& roles,
346  const std::vector<std::string>& grantees);
347  void revokeRole_unsafe(const std::string& roleName, const std::string& granteeName);
348  void updateObjectDescriptorMap(const std::string& roleName,
349  DBObject& object,
350  bool roleType,
352  void deleteObjectDescriptorMap(const std::string& roleName);
353  void deleteObjectDescriptorMap(const std::string& roleName,
354  DBObject& object,
356  void grantDBObjectPrivilegesBatch_unsafe(const std::vector<std::string>& grantees,
357  const std::vector<DBObject>& objects,
358  const Catalog_Namespace::Catalog& catalog);
359  void grantDBObjectPrivileges_unsafe(const std::string& granteeName,
360  const DBObject object,
361  const Catalog_Namespace::Catalog& catalog);
362  void revokeDBObjectPrivilegesBatch_unsafe(const std::vector<std::string>& grantees,
363  const std::vector<DBObject>& objects,
364  const Catalog_Namespace::Catalog& catalog);
365  void revokeDBObjectPrivileges_unsafe(const std::string& granteeName,
366  DBObject object,
367  const Catalog_Namespace::Catalog& catalog);
368  void grantAllOnDatabase_unsafe(const std::string& roleName,
369  DBObject& object,
370  const Catalog_Namespace::Catalog& catalog);
371  void revokeAllOnDatabase_unsafe(const std::string& roleName,
372  int32_t dbId,
373  Grantee* grantee);
374  bool isDashboardSystemRole(const std::string& roleName);
375  void updateUserRoleName(const std::string& roleName, const std::string& newName);
376 
382  bool allowLocalLogin() const;
383 
384  template <typename F, typename... Args>
385  void execInTransaction(F&& f, Args&&... args);
386 
387  std::string basePath_;
390  std::unique_ptr<SqliteConnector> sqliteConnector_;
391 
392  std::shared_ptr<Data_Namespace::DataMgr> dataMgr_;
393  std::unique_ptr<PkiServer> pki_server_;
395  std::shared_ptr<Calcite> calciteMgr_;
396  std::vector<LeafHostInfo> string_dict_hosts_;
399 
400  public:
401  mutable std::mutex sqliteMutex_;
403  mutable std::atomic<std::thread::id> thread_holding_sqlite_lock;
404  mutable std::atomic<std::thread::id> thread_holding_write_lock;
405  static thread_local bool thread_holds_read_lock;
406 };
407 
408 } // namespace Catalog_Namespace
409 
410 #endif // SYS_CATALOG_H
void revokeAllOnDatabase_unsafe(const std::string &roleName, int32_t dbId, Grantee *grantee)
void revokeDBObjectPrivilegesBatch_unsafe(const std::vector< std::string > &grantees, const std::vector< DBObject > &objects, const Catalog_Namespace::Catalog &catalog)
bool isDashboardSystemRole(const std::string &roleName)
void dropUser(const std::string &name)
Definition: SysCatalog.cpp:848
std::string cat(Ts &&...args)
auto duplicateAndRenameCatalog(std::string const &current_name, std::string const &new_name)
Definition: SysCatalog.cpp:94
SqliteConnector * getSqliteConnector()
Definition: SysCatalog.h:190
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:97
void createRole_unsafe(const std::string &roleName, const bool userPrivateRole=false)
void changeDBObjectOwnership(const UserMetadata &new_owner, const UserMetadata &previous_owner, DBObject object, const Catalog_Namespace::Catalog &catalog, bool revoke_privileges=true)
DBObjectType
Definition: DBObject.h:42
void revokeDashboardSystemRole(const std::string roleName, const std::vector< std::string > grantees)
std::map< std::string, Grantee * > GranteeMap
Definition: SysCatalog.h:304
void dropRole(const std::string &roleName)
bool checkPasswordForUser(const std::string &passwd, std::string &name, UserMetadata &user)
void revokeDBObjectPrivileges_unsafe(const std::string &granteeName, DBObject object, const Catalog_Namespace::Catalog &catalog)
UserMetadata(UserMetadata const &user_meta)
Definition: SysCatalog.h:84
void revokeDBObjectPrivilegesFromAll(DBObject object, Catalog *catalog)
bool getMetadataForUser(const std::string &name, UserMetadata &user)
void revokeDBObjectPrivileges(const std::string &grantee, const DBObject &object, const Catalog_Namespace::Catalog &catalog)
std::string name() const
Definition: SysCatalog.h:292
std::atomic< std::thread::id > thread_holding_sqlite_lock
Definition: SysCatalog.h:403
ObjectRoleDescriptorMap objectDescriptorMap_
Definition: SysCatalog.h:389
const std::string OMNISCI_SYSTEM_CATALOG
Definition: SysCatalog.h:55
Definition: Grantee.h:70
Grantee * getGrantee(const std::string &name) const
void dropDatabase(const DBMetadata &db)
void loginImpl(std::string &username, const std::string &password, UserMetadata &user_meta)
Definition: SysCatalog.cpp:757
void createUser(const std::string &name, const std::string &passwd, bool issuper, const std::string &dbname, bool can_login)
Definition: SysCatalog.cpp:796
UserMetadata(int32_t u, const std::string &n, const std::string &p, bool s, int32_t d, bool l)
Definition: SysCatalog.h:71
Definition: Grantee.h:76
bool getMetadataForUserById(const int32_t idIn, UserMetadata &user)
void init(const std::string &basePath, std::shared_ptr< Data_Namespace::DataMgr > dataMgr, const AuthMetadata &authMetadata, std::shared_ptr< Calcite > calcite, bool is_new_db, bool aggregator, const std::vector< LeafHostInfo > &string_dict_hosts)
Definition: SysCatalog.cpp:111
void createDBObject(const UserMetadata &user, const std::string &objectName, DBObjectType type, const Catalog_Namespace::Catalog &catalog, int32_t objectId=-1)
void grantRole_unsafe(const std::string &roleName, const std::string &granteeName)
void getDBObjectPrivileges(const std::string &granteeName, DBObject &object, const Catalog_Namespace::Catalog &catalog) const
void grantDBObjectPrivileges_unsafe(const std::string &granteeName, const DBObject object, const Catalog_Namespace::Catalog &catalog)
void alterUser(const int32_t userid, const std::string *passwd, bool *issuper, const std::string *dbname, bool *can_login)
Definition: SysCatalog.cpp:895
void grantRoleBatch(const std::vector< std::string > &roles, const std::vector< std::string > &grantees)
std::unique_ptr< PkiServer > pki_server_
Definition: SysCatalog.h:393
void revokeDBObjectPrivilegesBatch(const std::vector< std::string > &grantees, const std::vector< DBObject > &objects, const Catalog_Namespace::Catalog &catalog)
const AuthMetadata * authMetadata_
Definition: SysCatalog.h:394
void createRole(const std::string &roleName, const bool &userPrivateRole=false)
void grantRoleBatch_unsafe(const std::vector< std::string > &roles, const std::vector< std::string > &grantees)
Data_Namespace::DataMgr & getDataMgr() const
Definition: SysCatalog.h:187
bool checkPrivileges(const UserMetadata &user, const std::vector< DBObject > &privObjects) const
void renameDBObject(const std::string &objectName, const std::string &newName, DBObjectType type, int32_t objectId, const Catalog_Namespace::Catalog &catalog)
static SysCatalog & instance()
Definition: SysCatalog.h:286
auto assembleCatalogName(std::string const &name)
Definition: SysCatalog.cpp:82
void getMetadataWithDefaultDB(std::string &dbname, const std::string &username, Catalog_Namespace::DBMetadata &db_meta, UserMetadata &user_meta)
void grantAllOnDatabase_unsafe(const std::string &roleName, DBObject &object, const Catalog_Namespace::Catalog &catalog)
const std::string OMNISCI_DEFAULT_DB
Definition: SysCatalog.h:56
std::shared_timed_mutex mapd_shared_mutex
void renameObjectsInDescriptorMap(DBObject &object, const Catalog_Namespace::Catalog &cat)
bool checkPasswordForUserImpl(const std::string &passwd, std::string &name, UserMetadata &user)
std::shared_ptr< Catalog > login(std::string &db, std::string &username, const std::string &password, UserMetadata &user_meta, bool check_password=true)
Definition: SysCatalog.cpp:729
void revokeRoleBatch_unsafe(const std::vector< std::string > &roles, const std::vector< std::string > &grantees)
void revokeRoleBatch(const std::vector< std::string > &roles, const std::vector< std::string > &grantees)
std::shared_ptr< Data_Namespace::DataMgr > dataMgr_
Definition: SysCatalog.h:392
DBSummaryList getDatabaseListForUser(const UserMetadata &user)
std::shared_ptr< Catalog > switchDatabase(std::string &dbname, const std::string &username)
Definition: SysCatalog.cpp:765
Role * getRoleGrantee(const std::string &name) const
mapd_shared_mutex sharedMutex_
Definition: SysCatalog.h:402
void revokeDBObjectPrivilegesFromAllBatch_unsafe(std::vector< DBObject > &objects, Catalog *catalog)
User * getUserGrantee(const std::string &name) const
void grantDBObjectPrivilegesBatch(const std::vector< std::string > &grantees, const std::vector< DBObject > &objects, const Catalog_Namespace::Catalog &catalog)
void grantDBObjectPrivileges(const std::string &grantee, const DBObject &object, const Catalog_Namespace::Catalog &catalog)
std::unique_ptr< SqliteConnector > sqliteConnector_
Definition: SysCatalog.h:390
CommonFileOperations(std::string const &base_path)
Definition: SysCatalog.h:122
void updateUserRoleName(const std::string &roleName, const std::string &newName)
Definition: SysCatalog.cpp:964
std::list< UserMetadata > getAllUserMetadata()
void grantDBObjectPrivilegesBatch_unsafe(const std::vector< std::string > &grantees, const std::vector< DBObject > &objects, const Catalog_Namespace::Catalog &catalog)
void execInTransaction(F &&f, Args &&...args)
void check_for_session_encryption(const std::string &pki_cert, std::string &session)
Definition: SysCatalog.cpp:788
void syncUserWithRemoteProvider(const std::string &user_name, std::vector< std::string > idp_roles, bool *issuper)
void renameUser(std::string const &old_name, std::string const &new_name)
Definition: SysCatalog.cpp:976
void revokeRole_unsafe(const std::string &roleName, const std::string &granteeName)
bool isRoleGrantedToGrantee(const std::string &granteeName, const std::string &roleName, bool only_direct) const
bool hasAnyPrivileges(const UserMetadata &user, std::vector< DBObject > &privObjects)
void deleteObjectDescriptorMap(const std::string &roleName)
void removeCatalogByName(std::string const &name)
Definition: SysCatalog.cpp:90
const std::string OMNISCI_ROOT_USER
Definition: SysCatalog.h:57
const std::string OMNISCI_ROOT_PASSWD_DEFAULT
Definition: SysCatalog.h:60
void updateObjectDescriptorMap(const std::string &roleName, DBObject &object, bool roleType, const Catalog_Namespace::Catalog &cat)
void grantRole(const std::string &role, const std::string &grantee)
const int OMNISCI_ROOT_USER_ID
Definition: SysCatalog.h:58
std::list< DBMetadata > getAllDBMetadata()
void renameDatabase(std::string const &old_name, std::string const &new_name)
const std::string & getBasePath() const
Definition: SysCatalog.h:189
void revokeDBObjectPrivilegesFromAll_unsafe(DBObject object, Catalog *catalog)
bool verifyDBObjectOwnership(const UserMetadata &user, DBObject object, const Catalog_Namespace::Catalog &catalog)
const std::string OMNISCI_ROOT_USER_ID_STR
Definition: SysCatalog.h:59
std::vector< LeafHostInfo > string_dict_hosts_
Definition: SysCatalog.h:396
bool g_enable_watchdog false
Definition: Execute.cpp:73
std::vector< std::shared_ptr< Catalog > > getCatalogsForAllDbs()
Definition: SysCatalog.cpp:874
std::shared_ptr< Calcite > calciteMgr_
Definition: SysCatalog.h:395
std::unordered_map< std::string, std::vector< std::string > > getGranteesOfSharedDashboards(const std::vector< std::string > &dashboard_ids)
std::list< DBSummary > DBSummaryList
Definition: SysCatalog.h:118
void populateRoleDbObjects(const std::vector< DBObject > &objects)
static thread_local bool thread_holds_read_lock
Definition: SysCatalog.h:405
void grantDefaultPrivilegesToRole_unsafe(const std::string &name, bool issuper)
void revokeRole(const std::string &role, const std::string &grantee)
Calcite & getCalciteMgr() const
Definition: SysCatalog.h:188
std::multimap< std::string, ObjectRoleDescriptor * > ObjectRoleDescriptorMap
Definition: SysCatalog.h:305
string name
Definition: setup.py:35
bool getMetadataForDBById(const int32_t idIn, DBMetadata &db)
void createDatabase(const std::string &dbname, int owner)
void removeCatalogByFullPath(std::string const &full_path)
Definition: SysCatalog.cpp:86
std::vector< ObjectRoleDescriptor * > getMetadataForObject(int32_t dbId, int32_t dbType, int32_t objectId) const
std::atomic< bool > isSuper
Definition: SysCatalog.h:94
bool getMetadataForDB(const std::string &name, DBMetadata &db)
void revokeDBObjectPrivilegesFromAllBatch(std::vector< DBObject > &objects, Catalog *catalog)
void dropRole_unsafe(const std::string &roleName)
std::vector< std::string > getRoles(bool userPrivateRole, bool isSuper, const std::string &userName)
std::atomic< std::thread::id > thread_holding_write_lock
Definition: SysCatalog.h:404