18 if (!_missingPermissionWarned)
20 _missingPermissionWarned =
true;
22 "Denying '{}': no HasPermission policy is installed. "
23 "Set Runtime::Policy.HasPermission in Load.",
73 return std::unexpected(
allowed.error());
80 return std::unexpected(
allowed.error());
97 return std::unexpected(
allowed.error());
One connected player, owned by PlayerManager for the length of the connection.
Status AuthorizeSteamId(PlayerRef caller, int64_t targetSteamId, std::string_view permission) const
Authorize for a target that may be offline, addressed by SteamID.
std::function< bool(int64_t steamId, std::string_view permission)> HasPermission
std::function< bool(int64_t callerSteamId, int64_t targetSteamId)> CanTarget
Result< Authorized > Authorize(PlayerRef caller, std::optional< PlayerRef > target, std::string_view permission) const
The single gate. Commands, target resolution and menu rows call exactly this.
void Error(std::format_string< Args... > fmt, Args &&... args)
@ NotFound
The named thing does not exist (no such player, convar, row).
static std::string ReadFile(const std::filesystem::path &path)
std::expected< void, Error > Status
std::expected< T, Error > Result
A caller/target pair that cleared Policy::Authorize.
One failure: a code to branch on, text for the log, and an optional translation key.
static Error Denied(std::string key)
static Error Immune(std::string key)
static Error NotFound(std::string detail)
A storable reference to a player: the slot plus the SteamID that occupied it.