Class Grantee

class Grantee

Subclassed by Role, User

Public Functions

Grantee(const std::string &name)
~Grantee()
virtual bool isUser() const = 0
void grantPrivileges(const DBObject &object)
DBObject *revokePrivileges(const DBObject &object)
void grantRole(Role *role)
void revokeRole(Role *role)
bool hasAnyPrivileges(const DBObject &objectRequested, bool only_direct) const
bool checkPrivileges(const DBObject &objectRequested) const
void updatePrivileges()
void updatePrivileges(Role *role)
void revokeAllOnDatabase(int32_t dbId)
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>>