Trait CedarAction

Source
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§

Source

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§

Source

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.

Implementors§