pub struct ResourceRef { /* private fields */ }Expand description
One resource instance a check is made against: the resource and its
identifiers, root to leaf, so the parent chain (the tenant at its root)
travels with it. The leaf may be Target::All.
Implementations§
Source§impl ResourceRef
impl ResourceRef
Sourcepub fn new<I>(resource: &'static ResourceInfo, identifiers: I) -> Self
pub fn new<I>(resource: &'static ResourceInfo, identifiers: I) -> Self
resource named by identifiers, root to leaf: one per identifier
of the resource. A check whose count differs is refused by the
Permissions interceptor as a wiring error.
Sourcepub fn all<I>(resource: &'static ResourceInfo, parents: I) -> Self
pub fn all<I>(resource: &'static ResourceInfo, parents: I) -> Self
Every instance of resource under parents (root to leaf: every
identifier but the resource’s own): Inbox(*) in a workspace.
pub fn resource(&self) -> &'static ResourceInfo
Sourcepub fn identifiers(&self) -> &[Target]
pub fn identifiers(&self) -> &[Target]
Root to leaf.
Sourcepub fn identifier(&self, name: &str) -> Option<&Target>
pub fn identifier(&self, name: &str) -> Option<&Target>
The identifier the resource calls name ("workspaceId").
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether every identifier of the resource is bound, once, with only
the leaf possibly All.
Sourcepub fn binds_nothing(&self) -> bool
pub fn binds_nothing(&self) -> bool
Whether nothing of the request is bound: a root resource with *.
There is nothing to hide then, so a Hidden verdict on it is Denied.
Sourcepub fn not_found(&self) -> Error
pub fn not_found(&self) -> Error
The 404 for this instance, identical whether it is hidden or
genuinely missing: a MissingResource, which the server answers as
the framework’s NotFound, or as the service’s own not-found error
when the model designates one.
Trait Implementations§
Source§impl Clone for ResourceRef
impl Clone for ResourceRef
Source§impl Debug for ResourceRef
impl Debug for ResourceRef
Source§impl Display for ResourceRef
inbox(w-1, i-1), for logs.
impl Display for ResourceRef
inbox(w-1, i-1), for logs.