xentara-plugin v2.0.4
The Xentara Plugin Framework
|
An entitlement that can be used to restrict access to a protected resource. More...
#include <xentara/security/Entitlement.hpp>
Public Member Functions | |
constexpr | Entitlement (const utils::core::Uuid &uuid, std::string_view name, bool allowedByDefault) |
Constructor. | |
constexpr auto | name () const -> const std::string_view & |
Gets the name. | |
constexpr auto | uuid () const -> const utils::core::Uuid & |
Gets the UUID. | |
constexpr auto | allowedByDefault () const noexcept -> bool |
Determine if the entitlement will be allowed by default. | |
template<std::equality_comparable_with< std::string_view > String> | |
auto | operator== (const String &rhs) const -> bool |
Checks the name of the entitlement. | |
Static Public Attributes | |
Built-In entitlements | |
static const Entitlement | kRead |
The entitlement for read access. | |
static const Entitlement | kWrite |
The entitlement for write access. | |
static const Entitlement | KSuspend |
The entitlement for suspend stage. | |
static const Entitlement | KShutdown |
The entitlement for shutdown stage. | |
Special entitlements | |
static const Entitlement | kAllow |
An entitlement that is always allowed. | |
static const Entitlement | kDeny |
An entitlement that is always denied. | |
An entitlement that can be used to restrict access to a protected resource.
|
constexpr |
Constructor.
uuid | The UUID of the entitlement |
name | The name of the entitlement, in UTF-8 encoding. The string data the view references to is not copied. It must remain valid for the lifetime of the entitlement. |
allowedByDefault | true to allow the entitlement by default, or false if the entitlement must be explicitly allowed in an ACL. |
|
constexprnoexcept |
Determine if the entitlement will be allowed by default.
|
constexpr |
Gets the name.
auto xentara::security::Entitlement::operator== | ( | const String & | rhs | ) | const -> bool |
Checks the name of the entitlement.
This is a convenience operator you can use to check the name of an entitlement when resolving it. It is equivalent to name() == rhs.
|
constexpr |
Gets the UUID.
|
static |
An entitlement that is always allowed.
This is a dummy entitlement that is always allowed. The entitlement is not allowed for default constructed authorization objects that have no entitlements whatsoever.
|
static |
An entitlement that is always denied.
This is a dummy entitlement that is always denied.
|
static |
The entitlement for read access.
|
static |
The entitlement for shutdown stage.
|
static |
The entitlement for suspend stage.
|
static |
The entitlement for write access.