107 return "not possible";
111 if (type.compare(
"DATABASE") == 0) {
113 }
else if (type.compare(
"TABLE") == 0) {
115 }
else if (type.compare(
"DASHBOARD") == 0) {
117 }
else if (type.compare(
"VIEW") == 0) {
119 }
else if (type.compare(
"SERVER") == 0) {
122 throw std::runtime_error(
"DB object type " + type +
" is not supported.");
127 : objectName_(name) {
142 : objectName_(object.objectName_), ownerId_(object.ownerId_) {
168 std::vector<std::string> objectKey;
195 throw std::runtime_error(
"Failure generating DB object key. Database " +
getName() +
218 throw std::runtime_error(
"Failure generating DB object key. Server " +
219 getName() +
" does not exist.");
237 throw std::runtime_error(
"Failure generating DB object key. Table/View " +
238 getName() +
" does not exist.");
254 throw std::runtime_error(
255 "Failure generating DB object key. Dashboard with ID " +
277 objectKey.
dbId = std::stoi(key[1]);
284 objectKey.
dbId = std::stoi(key[1]);
285 objectKey.
objectId = std::stoi(key[2]);
static const AccessPrivileges TRUNCATE_VIEW
static const AccessPrivileges VIEW_SQL_EDITOR
static const int32_t SERVER_USAGE
static const AccessPrivileges VIEW_DASHBOARD
static const int32_t DROP_VIEW
static const int32_t ALTER_SERVER
static const AccessPrivileges DROP_SERVER
static const int32_t SELECT_FROM_VIEW
class for a per-database catalog. also includes metadata for the current database and the current use...
static const int32_t UPDATE_IN_VIEW
static const AccessPrivileges ALL_DATABASE
void copyPrivileges(const DBObject &object)
static const AccessPrivileges ALTER_TABLE
static const int32_t CREATE_VIEW
void updatePrivileges(const DBObject &object)
static const AccessPrivileges TRUNCATE_TABLE
static const AccessPrivileges ALL_TABLE_MIGRATE
const foreign_storage::ForeignServer * getForeignServer(const std::string &server_name) const
static const AccessPrivileges INSERT_INTO_TABLE
void revokePrivileges(const DBObject &object)
static const AccessPrivileges CREATE_DASHBOARD
static const AccessPrivileges SERVER_USAGE
void setObjectKey(const DBObjectKey &objectKey)
static const AccessPrivileges UPDATE_IN_VIEW
static const int32_t ALTER_TABLE
static const AccessPrivileges SELECT_FROM_TABLE
DBObject(const std::string &name, const DBObjectType &objectAndPermissionType)
AccessPrivileges objectPrivs_
static const AccessPrivileges ALL_VIEW
DBObjectType DBObjectTypeFromString(const std::string &type)
static const AccessPrivileges ALTER_SERVER
This file contains the class specification and related data structures for Catalog.
static const AccessPrivileges INSERT_INTO_VIEW
static const int32_t ALL_MIGRATE
static DBObjectKey fromString(const std::vector< std::string > &key, const DBObjectType &type)
static SysCatalog & instance()
void setPermissionType(const DBObjectType &permissionType)
const DBMetadata & getCurrentDB() const
static const AccessPrivileges DROP_TABLE
std::vector< std::string > toString() const
static const int32_t ALL_MIGRATE
static const int32_t DELETE_FROM_TABLE
static const AccessPrivileges ALL_DASHBOARD_MIGRATE
Class specification and related data structures for DBObject class.
static const int32_t TRUNCATE_TABLE
const DashboardDescriptor * getMetadataForDashboard(const std::string &userId, const std::string &dashName) const
static const AccessPrivileges ALL_SERVER
static const AccessPrivileges CREATE_SERVER
static const AccessPrivileges DELETE_FROM_TABLE
std::string getName() const
static const AccessPrivileges NONE
static const int32_t EDIT_DASHBOARD
static const int32_t DELETE_DASHBOARD
static const AccessPrivileges CREATE_TABLE
static const int32_t INSERT_INTO_TABLE
static const AccessPrivileges DELETE_FROM_VIEW
std::string DBObjectTypeToString(DBObjectType type)
static const int32_t CREATE_SERVER
void setObjectType(const DBObjectType &objectType)
static const int32_t ALL_MIGRATE
static const AccessPrivileges ALL_VIEW_MIGRATE
static const AccessPrivileges SELECT_FROM_VIEW
static const int32_t ACCESS
static const AccessPrivileges ALL_DASHBOARD
static const AccessPrivileges ACCESS
static const int32_t VIEW_DASHBOARD
static const AccessPrivileges ALL_TABLE
static const int32_t VIEW_SQL_EDITOR
static const int32_t DROP_TABLE
static const int32_t INSERT_INTO_VIEW
static const AccessPrivileges DROP_VIEW
static const int32_t DELETE_FROM_VIEW
static const AccessPrivileges CREATE_VIEW
static const int32_t CREATE_TABLE
static const int32_t CREATE_DASHBOARD
static const AccessPrivileges DELETE_DASHBOARD
static const int32_t SELECT_FROM_TABLE
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
static const AccessPrivileges EDIT_DASHBOARD
static const AccessPrivileges UPDATE_IN_TABLE
static const int32_t UPDATE_IN_TABLE
static const int32_t TRUNCATE_VIEW
static const int32_t DROP_SERVER