OmniSciDB
0264ff685a
|
#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 () | |
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) |
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 115 of file DBObject.cpp.
References objectKey_, objectType_, ownerId_, and DBObjectKey::permissionType.
DBObject::DBObject | ( | const int32_t | id, |
const DBObjectType & | objectAndPermissionType | ||
) |
Definition at line 122 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 130 of file DBObject.cpp.
References copyPrivileges(), objectKey_, objectType_, and setObjectKey().
|
inline |
Definition at line 205 of file DBObject.h.
void DBObject::copyPrivileges | ( | const DBObject & | object | ) |
Definition at line 137 of file DBObject.cpp.
References objectPrivs_.
Referenced by DBObject().
|
inline |
Definition at line 209 of file DBObject.h.
Referenced by loadKey(), and serialize_db_object().
|
inline |
load key not called?
Definition at line 211 of file DBObject.h.
References CHECK.
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 |
Definition at line 224 of file DBObject.h.
|
inline |
Definition at line 216 of file DBObject.h.
Referenced by Parser::ShowPrivilegesStmt::execute(), DBHandler::get_dashboard_impl(), hasAnyPrivs(), hasEnoughPrivs(), and serialize_db_object().
|
inline |
Definition at line 210 of file DBObject.h.
Referenced by serialize_db_object().
|
inline |
Definition at line 221 of file DBObject.h.
void DBObject::loadKey | ( | ) |
Definition at line 179 of file DBObject.cpp.
References CHECK, DatabaseDBObjectType, DBObjectKey::dbId, Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::DBMetadata::dbOwner, getName(), Catalog_Namespace::SysCatalog::instance(), objectKey_, objectType_, and ownerId_.
Referenced by Parser::check_alter_table_privilege(), DBHandler::check_table_load_privileges(), Parser::TruncateTableStmt::execute(), Parser::CopyTableStmt::execute(), Parser::ShowCreateTableStmt::execute(), Catalog_Namespace::Catalog::filterTableByTypeAndUser(), DBHandler::get_db_object_privs(), Catalog_Namespace::SysCatalog::getDatabaseListForUser(), Catalog_Namespace::Catalog::getForeignServersForUser(), DBHandler::has_object_privilege(), DBHandler::hasTableAccessPrivileges(), loadKey(), Catalog_Namespace::SysCatalog::revokeDBObjectPrivilegesFromAll_unsafe(), Catalog_Namespace::SysCatalog::switchDatabase(), and DBHandler::user_can_access_table().
void DBObject::loadKey | ( | const Catalog_Namespace::Catalog & | catalog | ) |
Definition at line 194 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 218 of file DBObject.h.
void DBObject::revokePrivileges | ( | const DBObject & | object | ) |
Definition at line 145 of file DBObject.cpp.
References objectPrivs_, and AccessPrivileges::privileges.
|
inline |
Definition at line 208 of file DBObject.h.
References setup::name.
Referenced by Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
inline |
Definition at line 215 of file DBObject.h.
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 152 of file DBObject.cpp.
References objectType_.
Referenced by Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
inline |
Definition at line 225 of file DBObject.h.
References toString().
Referenced by Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions().
void DBObject::setPermissionType | ( | const DBObjectType & | permissionType | ) |
Definition at line 149 of file DBObject.cpp.
References objectKey_, and DBObjectKey::permissionType.
Referenced by Catalog_Namespace::SysCatalog::grantAllOnDatabase_unsafe().
|
inline |
Definition at line 217 of file DBObject.h.
Referenced by Parser::check_alter_table_privilege(), DBHandler::check_table_load_privileges(), Parser::TruncateTableStmt::execute(), Parser::CopyTableStmt::execute(), Catalog_Namespace::SysCatalog::getDatabaseListForUser(), Catalog_Namespace::SysCatalog::grantAllOnDatabase_unsafe(), Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions(), Catalog_Namespace::SysCatalog::revokeDBObjectPrivilegesFromAll_unsafe(), Catalog_Namespace::SysCatalog::switchDatabase(), and DBHandler::user_can_access_table().
std::vector< std::string > DBObject::toString | ( | ) | const |
Definition at line 156 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 141 of file DBObject.cpp.
References objectPrivs_, and AccessPrivileges::privileges.
Referenced by Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges().
|
private |
Definition at line 233 of file DBObject.h.
Referenced by DBObject(), loadKey(), setPermissionType(), and toString().
|
private |
Definition at line 231 of file DBObject.h.
Referenced by loadKey().
|
private |
Definition at line 234 of file DBObject.h.
Referenced by copyPrivileges(), revokePrivileges(), and updatePrivileges().
|
private |
Definition at line 232 of file DBObject.h.
Referenced by DBObject(), loadKey(), and setObjectType().
|
private |
Definition at line 235 of file DBObject.h.
Referenced by DBObject(), and loadKey().