OmniSciDB
a5dc49c757
|
#include <Grantee.h>
Public Member Functions | |
Grantee (const std::string &name) | |
virtual | ~Grantee () |
virtual bool | isUser () const =0 |
virtual void | grantPrivileges (const DBObject &object) |
virtual DBObject * | revokePrivileges (const DBObject &object) |
virtual void | grantRole (Role *role) |
virtual void | revokeRole (Role *role) |
virtual bool | hasAnyPrivileges (const DBObject &objectRequested, bool only_direct) const |
virtual bool | checkPrivileges (const DBObject &objectRequested) const |
virtual void | updatePrivileges () |
virtual void | updatePrivileges (Role *role) |
virtual void | revokeAllOnDatabase (int32_t dbId) |
virtual void | renameDbObject (const DBObject &object) |
void | getPrivileges (DBObject &object, bool only_direct) |
DBObject * | findDbObject (const DBObjectKey &objectKey, bool only_direct) const |
bool | hasAnyPrivilegesOnDb (int32_t dbId, bool only_direct) const |
const std::string & | getName () const |
void | setName (const std::string &name) |
std::vector< std::string > | getRoles (bool only_direct=true) const |
bool | hasRole (Role *role, bool only_direct) const |
const DBObjectMap * | getDbObjects (bool only_direct) const |
void | checkCycles (Role *newRole) |
void | reassignObjectOwners (const std::set< int32_t > &old_owner_ids, int32_t new_owner_id, int32_t db_id) |
void | reassignObjectOwner (DBObjectKey &object_key, int32_t new_owner_id) |
Protected Attributes | |
std::string | name_ |
std::unordered_set< Role * > | roles_ |
DBObjectMap | effectivePrivileges_ |
DBObjectMap | directPrivileges_ |
Private Types | |
using | DBObjectMap = std::map< DBObjectKey, std::unique_ptr< DBObject >> |
|
private |
Grantee::Grantee | ( | const std::string & | name | ) |
Definition at line 26 of file Grantee.cpp.
|
virtual |
Definition at line 28 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, and roles_.
void Grantee::checkCycles | ( | Role * | newRole | ) |
Definition at line 310 of file Grantee.cpp.
References CHECK, Role::getGrantees(), and getName().
Referenced by grantRole().
|
virtual |
Definition at line 231 of file Grantee.cpp.
References DBObjectKey::dbId, findDbObject(), DBObject::getObjectKey(), hasEnoughPrivs(), and DBObjectKey::objectId.
DBObject * Grantee::findDbObject | ( | const DBObjectKey & | objectKey, |
bool | only_direct | ||
) | const |
Definition at line 85 of file Grantee.cpp.
References directPrivileges_, and effectivePrivileges_.
Referenced by checkPrivileges(), Catalog_Namespace::Catalog::createOrUpdateDashboardSystemRole(), getPrivileges(), grantPrivileges(), DBHandler::has_object_privilege(), hasAnyPrivileges(), revokePrivileges(), updatePrivileges(), and Catalog_Namespace::SysCatalog::verifyDBObjectOwnership().
|
inline |
Definition at line 56 of file Grantee.h.
References directPrivileges_, and effectivePrivileges_.
Referenced by Catalog_Namespace::Catalog::createOrUpdateDashboardSystemRole(), and updatePrivileges().
|
inline |
Definition at line 52 of file Grantee.h.
References name_.
Referenced by Role::addGrantee(), checkCycles(), getPrivileges(), grantRole(), Role::removeGrantee(), renameDbObject(), and revokePrivileges().
void Grantee::getPrivileges | ( | DBObject & | object, |
bool | only_direct | ||
) |
Definition at line 76 of file Grantee.cpp.
References findDbObject(), and getName().
std::vector< std::string > Grantee::getRoles | ( | bool | only_direct = true | ) | const |
Definition at line 37 of file Grantee.cpp.
|
virtual |
Definition at line 105 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, findDbObject(), and updatePrivileges().
Referenced by Catalog_Namespace::SysCatalog::createDBObject().
|
virtual |
Definition at line 163 of file Grantee.cpp.
References Role::addGrantee(), checkCycles(), getName(), name_, roles_, and updatePrivileges().
|
virtual |
Definition at line 207 of file Grantee.cpp.
References DBObjectKey::dbId, findDbObject(), DBObject::getObjectKey(), hasAnyPrivs(), and DBObjectKey::objectId.
bool Grantee::hasAnyPrivilegesOnDb | ( | int32_t | dbId, |
bool | only_direct | ||
) | const |
Definition at line 95 of file Grantee.cpp.
References directPrivileges_, and effectivePrivileges_.
Referenced by Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::get_users().
bool Grantee::hasRole | ( | Role * | role, |
bool | only_direct | ||
) | const |
Definition at line 55 of file Grantee.cpp.
References roles_.
Referenced by Catalog_Namespace::SysCatalog::isRoleGrantedToGrantee().
void Grantee::reassignObjectOwner | ( | DBObjectKey & | object_key, |
int32_t | new_owner_id | ||
) |
void Grantee::reassignObjectOwners | ( | const std::set< int32_t > & | old_owner_ids, |
int32_t | new_owner_id, | ||
int32_t | db_id | ||
) |
Definition at line 330 of file Grantee.cpp.
References shared::contains(), directPrivileges_, and effectivePrivileges_.
|
virtual |
Reimplemented in Role.
Definition at line 121 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, and getName().
Referenced by Role::renameDbObject(), Catalog_Namespace::SysCatalog::renameDBObject(), Catalog_Namespace::Catalog::renameTable(), and Catalog_Namespace::Catalog::renameTables().
|
virtual |
Reimplemented in Role.
Definition at line 296 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, and updatePrivileges().
Referenced by Role::revokeAllOnDatabase(), and Catalog_Namespace::SysCatalog::revokeAllOnDatabase_unsafe().
Definition at line 136 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, findDbObject(), getName(), and updatePrivileges().
|
virtual |
Definition at line 181 of file Grantee.cpp.
References Role::removeGrantee(), roles_, and updatePrivileges().
|
inline |
|
virtual |
Reimplemented in Role.
Definition at line 268 of file Grantee.cpp.
References directPrivileges_, effectivePrivileges_, and roles_.
Referenced by grantPrivileges(), grantRole(), revokeAllOnDatabase(), revokePrivileges(), revokeRole(), and Role::updatePrivileges().
|
virtual |
Definition at line 255 of file Grantee.cpp.
References effectivePrivileges_, findDbObject(), and getDbObjects().
|
protected |
Definition at line 72 of file Grantee.h.
Referenced by findDbObject(), getDbObjects(), grantPrivileges(), hasAnyPrivilegesOnDb(), reassignObjectOwner(), reassignObjectOwners(), renameDbObject(), revokeAllOnDatabase(), revokePrivileges(), updatePrivileges(), and ~Grantee().
|
protected |
Definition at line 70 of file Grantee.h.
Referenced by findDbObject(), getDbObjects(), grantPrivileges(), hasAnyPrivilegesOnDb(), reassignObjectOwner(), reassignObjectOwners(), renameDbObject(), revokeAllOnDatabase(), revokePrivileges(), updatePrivileges(), and ~Grantee().
|
protected |
Definition at line 67 of file Grantee.h.
Referenced by getName(), grantRole(), and setName().
|
protected |
Definition at line 68 of file Grantee.h.
Referenced by grantRole(), hasRole(), revokeRole(), updatePrivileges(), and ~Grantee().