31 #include <unordered_set>
34 namespace Catalog_Namespace {
62 return memcmp(ids_a, ids_b,
N_COLUMNS *
sizeof(int32_t)) < 0;
77 static const int32_t
ALL = -1;
81 static const int32_t
ACCESS = 1 << 3;
85 static const int32_t
ALL = -1;
100 static const int32_t
ALL = -1;
111 static const int32_t
ALL = -1;
125 static const int32_t
ALL = -1;
142 return permission == (
privileges & permission);
236 std::vector<std::string>
toString()
const;
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
DBObjectKey getObjectKey() const
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
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
void setName(std::string name)
void setPrivileges(const AccessPrivileges &privs)
static const AccessPrivileges SELECT_FROM_TABLE
DBObject(const std::string &name, const DBObjectType &objectAndPermissionType)
bool operator<(const DBObjectKey &key) const
AccessPrivileges objectPrivs_
static const size_t N_COLUMNS
static const AccessPrivileges ALL_VIEW
DBObject(const std::string &name, DBObjectType type, DBObjectKey key, AccessPrivileges privs, int32_t owner)
DBObjectType DBObjectTypeFromString(const std::string &type)
static const AccessPrivileges ALTER_SERVER
static const AccessPrivileges INSERT_INTO_VIEW
void add(AccessPrivileges newprivs)
static const int32_t ALL_MIGRATE
static DBObjectKey fromString(const std::vector< std::string > &key, const DBObjectType &type)
void setPermissionType(const DBObjectType &permissionType)
static const int32_t DROP_DATABASE
static const AccessPrivileges DROP_TABLE
std::vector< std::string > toString() const
static const int32_t ALL_MIGRATE
static const int32_t DELETE_FROM_TABLE
void grantPrivileges(const DBObject &object)
static const AccessPrivileges ALL_DASHBOARD_MIGRATE
static const int32_t TRUNCATE_TABLE
static const AccessPrivileges ALL_SERVER
static const AccessPrivileges CREATE_SERVER
void setOwner(int32_t userId)
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)
DBObjectType getType() const
static const int32_t CREATE_SERVER
const AccessPrivileges & getPrivileges() const
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 int32_t CREATE_DATABASE
DBObject(DBObjectKey key, AccessPrivileges privs, int32_t owner)
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
static const AccessPrivileges EDIT_DASHBOARD
static const AccessPrivileges UPDATE_IN_TABLE
bool operator==(const DBObjectKey &key) const
static const int32_t UPDATE_IN_TABLE
static const int32_t TRUNCATE_VIEW
bool hasPermission(int permission) const
AccessPrivileges(int64_t priv)
static const int32_t DROP_SERVER