Fixed permissions

This commit is contained in:
WolverinDEV 2021-04-28 18:43:30 +02:00
parent 6ad9f7d3f0
commit c7985c4dd1

View File

@ -832,6 +832,21 @@ namespace ts {
return false;
}
/**
* Set the permission value to zero if the permission hasn't been set.
* This could be used to check if a client could do an action on another client
* but the client requires at least some power.
* @return
*/
constexpr auto& zero_if_unset() {
if(!this->has_value) {
this->has_value = true;
this->value = 0;
}
return *this;
}
inline bool operator==(const PermissionFlaggedValue& other) const { return other.value == this->value && other.has_value == this->has_value; }
inline bool operator!=(const PermissionFlaggedValue& other) const { return !(*this == other); }
};