Fixed permissions
This commit is contained in:
parent
6ad9f7d3f0
commit
c7985c4dd1
@ -832,6 +832,21 @@ namespace ts {
|
|||||||
return false;
|
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 other.value == this->value && other.has_value == this->has_value; }
|
||||||
inline bool operator!=(const PermissionFlaggedValue& other) const { return !(*this == other); }
|
inline bool operator!=(const PermissionFlaggedValue& other) const { return !(*this == other); }
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user