Struct cedar_policy::RequestBuilder
source · pub struct RequestBuilder<S> { /* private fields */ }
partial-eval
only.Expand description
Builder for a Request
The default for principal, action, resource, and context fields is Unknown for partial evaluation.
Implementations§
source§impl<S> RequestBuilder<S>
impl<S> RequestBuilder<S>
sourcepub fn principal(self, principal: Option<EntityUid>) -> Self
pub fn principal(self, principal: Option<EntityUid>) -> Self
Set the principal.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for principal
indicates that principal
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.
sourcepub fn action(self, action: Option<EntityUid>) -> Self
pub fn action(self, action: Option<EntityUid>) -> Self
Set the action.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for action
indicates that action
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.
sourcepub fn resource(self, resource: Option<EntityUid>) -> Self
pub fn resource(self, resource: Option<EntityUid>) -> Self
Set the resource.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for resource
indicates that resource
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.