OmniSciDB
a5dc49c757
|
#include <DBObject.h>
Public Member Functions | |
DBObject (const std::string &name, const DBObjectType &objectAndPermissionType) | |
DBObject (const int32_t id, const DBObjectType &objectAndPermissionType) | |
DBObject (DBObjectKey key, AccessPrivileges privs, int32_t owner) | |
DBObject (const DBObject &object) | |
DBObject (const std::string &name, DBObjectType type, DBObjectKey key, AccessPrivileges privs, int32_t owner) | |
~DBObject () | |
void | setObjectType (const DBObjectType &objectType) |
void | setName (std::string name) |
std::string | getName () const |
DBObjectType | getType () const |
DBObjectKey | getObjectKey () const |
void | setObjectKey (const DBObjectKey &objectKey) |
const AccessPrivileges & | getPrivileges () const |
void | setPrivileges (const AccessPrivileges &privs) |
void | resetPrivileges () |
void | copyPrivileges (const DBObject &object) |
void | updatePrivileges (const DBObject &object) |
void | grantPrivileges (const DBObject &object) |
void | revokePrivileges (const DBObject &object) |
void | setPermissionType (const DBObjectType &permissionType) |
int32_t | getOwner () const |
void | setOwner (int32_t userId) |
std::vector< std::string > | toString () const |
void | loadKey () |
void | loadKey (const Catalog_Namespace::Catalog &catalog) |
bool | valid () const |
Private Attributes | |
std::string | objectName_ |
DBObjectType | objectType_ |
DBObjectKey | objectKey_ |
AccessPrivileges | objectPrivs_ |
int32_t | ownerId_ |
Definition at line 194 of file DBObject.h.
DBObject::DBObject | ( | const std::string & | name, |
const DBObjectType & | objectAndPermissionType | ||
) |
Definition at line 126 of file DBObject.cpp.
References objectKey_, objectType_, ownerId_, and DBObjectKey::permissionType.
DBObject::DBObject | ( | const int32_t | id, |
const DBObjectType & | objectAndPermissionType | ||
) |
Definition at line 133 of file DBObject.cpp.
References DBObjectKey::objectId, objectKey_, objectType_, ownerId_, and DBObjectKey::permissionType.
|
inline |
Definition at line 198 of file DBObject.h.
DBObject::DBObject | ( | const DBObject & | object | ) |
Definition at line 141 of file DBObject.cpp.
References copyPrivileges(), objectKey_, objectType_, and setObjectKey().
|
inline |
Definition at line 205 of file DBObject.h.
|
inline |
Definition at line 215 of file DBObject.h.
void DBObject::copyPrivileges | ( | const DBObject & | object | ) |
Definition at line 148 of file DBObject.cpp.
References objectPrivs_.
Referenced by DBObject().
|
inline |
Definition at line 219 of file DBObject.h.
References objectName_.
Referenced by loadKey(), and serialize_db_object().
|
inline |
load key not called?
Definition at line 221 of file DBObject.h.
References CHECK, DBObjectKey::dbId, and objectKey_.
Referenced by Grantee::checkPrivileges(), DBHandler::get_db_object_privs(), DBHandler::has_object_privilege(), Grantee::hasAnyPrivileges(), Catalog_Namespace::SysCatalog::revokeDBObjectPrivilegesFromAll_unsafe(), and serialize_db_object().
|
inline |
|
inline |
Definition at line 226 of file DBObject.h.
References objectPrivs_.
Referenced by Parser::ShowPrivilegesStmt::execute(), DBHandler::get_dashboard_impl(), hasAnyPrivs(), hasEnoughPrivs(), and serialize_db_object().
|
inline |
Definition at line 220 of file DBObject.h.
References objectType_.
Referenced by serialize_db_object().
|
inline |
Definition at line 231 of file DBObject.h.
References updatePrivileges().
void DBObject::loadKey | ( | ) |
Definition at line 190 of file DBObject.cpp.
References CHECK, DatabaseDBObjectType, DBObjectKey::dbId, Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::DBMetadata::dbName, Catalog_Namespace::DBMetadata::dbOwner, getName(), Catalog_Namespace::SysCatalog::instance(), objectKey_, objectName_, objectType_, and ownerId_.
Referenced by Parser::check_alter_table_privilege(), anonymous_namespace{Calcite.cpp}::check_db_access(), DBHandler::check_table_load_privileges(), DBHandler::connect(), ShowCreateServerCommand::execute(), ShowCreateTableCommand::execute(), ShowUserDetailsCommand::execute(), Parser::TruncateTableStmt::execute(), Parser::CopyTableStmt::execute(), Catalog_Namespace::Catalog::filterTableByTypeAndUser(), DBHandler::get_db_object_privs(), Catalog_Namespace::SysCatalog::getDatabaseListForUser(), Catalog_Namespace::Catalog::getForeignServersForUser(), DBHandler::has_object_privilege(), DBHandler::hasTableAccessPrivileges(), DBHandler::internal_connect(), loadKey(), Catalog_Namespace::SysCatalog::revokeDBObjectPrivilegesFromAll_unsafe(), Catalog_Namespace::SysCatalog::switchDatabase(), DBHandler::user_can_access_table(), and Parser::anonymous_namespace{ParserNode.cpp}::user_can_access_table().
void DBObject::loadKey | ( | const Catalog_Namespace::Catalog & | catalog | ) |
Definition at line 206 of file DBObject.cpp.
References CHECK, DashboardDBObjectType, DatabaseDBObjectType, DBObjectKey::dbId, Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::DBMetadata::dbOwner, Catalog_Namespace::Catalog::getCurrentDB(), Catalog_Namespace::Catalog::getForeignServer(), Catalog_Namespace::Catalog::getMetadataForDashboard(), Catalog_Namespace::Catalog::getMetadataForTable(), getName(), loadKey(), DBObjectKey::objectId, objectKey_, objectName_, objectType_, ownerId_, ServerDBObjectType, TableDBObjectType, to_string(), and ViewDBObjectType.
|
inline |
Definition at line 228 of file DBObject.h.
References objectPrivs_, and AccessPrivileges::reset().
void DBObject::revokePrivileges | ( | const DBObject & | object | ) |
Definition at line 156 of file DBObject.cpp.
References objectPrivs_, and AccessPrivileges::privileges.
|
inline |
Definition at line 218 of file DBObject.h.
References setup::name, and objectName_.
Referenced by Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
inline |
Definition at line 225 of file DBObject.h.
References objectKey_.
Referenced by Catalog_Namespace::SysCatalog::createRole_unsafe(), DBObject(), Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions(), and Catalog_Namespace::SysCatalog::renameDBObject().
void DBObject::setObjectType | ( | const DBObjectType & | objectType | ) |
Definition at line 163 of file DBObject.cpp.
References objectType_.
Referenced by Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
inline |
Definition at line 235 of file DBObject.h.
References ownerId_.
Referenced by Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions().
void DBObject::setPermissionType | ( | const DBObjectType & | permissionType | ) |
Definition at line 160 of file DBObject.cpp.
References objectKey_, and DBObjectKey::permissionType.
Referenced by Catalog_Namespace::SysCatalog::grantAllOnDatabase_unsafe().
|
inline |
Definition at line 227 of file DBObject.h.
References objectPrivs_.
Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::add_db_object(), Parser::check_alter_table_privilege(), anonymous_namespace{Calcite.cpp}::check_db_access(), DBHandler::check_table_load_privileges(), DBHandler::connect(), Parser::TruncateTableStmt::execute(), Parser::CopyTableStmt::execute(), Catalog_Namespace::SysCatalog::getDatabaseListForUser(), Catalog_Namespace::SysCatalog::grantAllOnDatabase_unsafe(), DBHandler::internal_connect(), Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions(), Catalog_Namespace::SysCatalog::revokeDBObjectPrivilegesFromAll_unsafe(), Catalog_Namespace::SysCatalog::switchDatabase(), DBHandler::user_can_access_table(), and Parser::anonymous_namespace{ParserNode.cpp}::user_can_access_table().
std::vector< std::string > DBObject::toString | ( | ) | const |
Definition at line 167 of file DBObject.cpp.
References CHECK, DashboardDBObjectType, DatabaseDBObjectType, DBObjectKey::dbId, DBObjectKey::objectId, objectKey_, DBObjectKey::permissionType, ServerDBObjectType, TableDBObjectType, to_string(), and ViewDBObjectType.
void DBObject::updatePrivileges | ( | const DBObject & | object | ) |
Definition at line 152 of file DBObject.cpp.
References objectPrivs_, and AccessPrivileges::privileges.
Referenced by grantPrivileges(), and Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
inline |
Definition at line 240 of file DBObject.h.
References AbstractDBObjectType, DBObjectKey::dbId, objectKey_, objectType_, and DBObjectKey::permissionType.
|
private |
Definition at line 248 of file DBObject.h.
Referenced by DBObject(), getObjectKey(), loadKey(), setObjectKey(), setPermissionType(), toString(), and valid().
|
private |
Definition at line 246 of file DBObject.h.
|
private |
Definition at line 249 of file DBObject.h.
Referenced by copyPrivileges(), getPrivileges(), resetPrivileges(), revokePrivileges(), setPrivileges(), and updatePrivileges().
|
private |
Definition at line 247 of file DBObject.h.
Referenced by DBObject(), getType(), loadKey(), setObjectType(), and valid().
|
private |
Definition at line 250 of file DBObject.h.
Referenced by DBObject(), getOwner(), loadKey(), and setOwner().