Add privilege check in triggers and streams (#200)
This commit is contained in:
committed by
GitHub
parent
09c58501f1
commit
09cfca35f8
@@ -216,7 +216,7 @@ void User::SetRole(const Role &role) { role_.emplace(role); }
|
||||
|
||||
void User::ClearRole() { role_ = std::nullopt; }
|
||||
|
||||
const Permissions User::GetPermissions() const {
|
||||
Permissions User::GetPermissions() const {
|
||||
if (role_) {
|
||||
return Permissions(permissions_.grants() | role_->permissions().grants(),
|
||||
permissions_.denies() | role_->permissions().denies());
|
||||
@@ -229,7 +229,12 @@ const std::string &User::username() const { return username_; }
|
||||
const Permissions &User::permissions() const { return permissions_; }
|
||||
Permissions &User::permissions() { return permissions_; }
|
||||
|
||||
std::optional<Role> User::role() const { return role_; }
|
||||
const Role *User::role() const {
|
||||
if (role_.has_value()) {
|
||||
return &role_.value();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nlohmann::json User::Serialize() const {
|
||||
nlohmann::json data = nlohmann::json::object();
|
||||
|
||||
Reference in New Issue
Block a user