pub trait CedarAction<Principal, Resource>: CedarActionEntity {
type Context: Serialize;
// Provided method
fn request(
principal: EntityUid<Principal>,
resource: EntityUid<Resource>,
ctx: &Self::Context,
schema: Option<&Schema>,
) -> Result<Request, CedarActionRequestError>
where Principal: CedarEntity,
Resource: CedarEntity { ... }
}
Expand description
A trait defining a relationship between a cedar action its principal and resource.
Required Associated Types§
Sourcetype Context: Serialize
type Context: Serialize
The context used by this action. Not all actions have contexts and if your action does not have a context you should use the crate::EmptyContext type.
Provided Methods§
Sourcefn request(
principal: EntityUid<Principal>,
resource: EntityUid<Resource>,
ctx: &Self::Context,
schema: Option<&Schema>,
) -> Result<Request, CedarActionRequestError>where
Principal: CedarEntity,
Resource: CedarEntity,
fn request(
principal: EntityUid<Principal>,
resource: EntityUid<Resource>,
ctx: &Self::Context,
schema: Option<&Schema>,
) -> Result<Request, CedarActionRequestError>where
Principal: CedarEntity,
Resource: CedarEntity,
Construct a cedar_policy::Request from this action.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.