Trait authzen_core::actions::TryUpdate
source · pub trait TryUpdate<'subject, 'context, 'input, Ctx>: Send + Syncwhere
Ctx: Sync + 'subject + 'context,{
// Provided methods
fn can_update<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: &'input I
) -> Pin<Box<dyn Future<Output = Result<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Ok, <DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error>> + Send + 'async_trait>>
where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
I: Send + Sync + 'async_trait,
'subject: 'async_trait,
'context: 'async_trait + 'input,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context { ... }
fn try_update<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: I
) -> Pin<Box<dyn Future<Output = Result<<Update<Self> as StorageAction<SC, I>>::Ok, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, I>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>
where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, I> + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
Update<Self>: StorageAction<SC, I>,
I: Send + Sync + 'async_trait,
'subject: 'async_trait,
'context: 'async_trait,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context { ... }
fn try_update_one<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: I
) -> Pin<Box<dyn Future<Output = Result<<<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, [I; 1]>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>
where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, [I; 1]> + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
Update<Self>: StorageAction<SC, [I; 1]>,
I: Send + Sync + 'async_trait,
<Update<Self> as StorageAction<SC, [I; 1]>>::Ok: IntoIterator,
<<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item: Send,
'subject: 'async_trait,
'context: 'async_trait,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context { ... }
}Expand description
Makes an authorization query and performs "update" action.
Includes:
- a query whether the action with type
"update"can be performed given the provided input and context (which must provide information about the event’s subject, context and decision maker). Automatically implmented for any object which can be queried about for the givenDecisionMaker. - upon approval of the action by the specified
DecisionMaker, the action is actually performed
Provided Methods§
sourcefn can_update<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: &'input I
) -> Pin<Box<dyn Future<Output = Result<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Ok, <DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error>> + Send + 'async_trait>>where
Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
I: Send + Sync + 'async_trait,
'subject: 'async_trait,
'context: 'async_trait + 'input,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context,
fn can_update<'life0, 'async_trait, DM, SC, TC, I>( ctx: &'life0 Ctx, input: &'input I ) -> Pin<Box<dyn Future<Output = Result<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Ok, <DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error>> + Send + 'async_trait>>where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait, DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait, SC: StorageClient + Send + Sync + 'async_trait, TC: Send + Sync + TransactionCache + 'async_trait, Ctx: AuthorizationContext<DM, SC, TC>, I: Send + Sync + 'async_trait, 'subject: 'async_trait, 'context: 'async_trait + 'input, 'input: 'async_trait, 'life0: 'async_trait + 'subject + 'context,
Query whether the subject is authorized to update the specified object(s).
sourcefn try_update<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: I
) -> Pin<Box<dyn Future<Output = Result<<Update<Self> as StorageAction<SC, I>>::Ok, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, I>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>where
Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, I> + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
Update<Self>: StorageAction<SC, I>,
I: Send + Sync + 'async_trait,
'subject: 'async_trait,
'context: 'async_trait,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context,
fn try_update<'life0, 'async_trait, DM, SC, TC, I>( ctx: &'life0 Ctx, input: I ) -> Pin<Box<dyn Future<Output = Result<<Update<Self> as StorageAction<SC, I>>::Ok, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, I>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait, DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, I, <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait, SC: StorageClient + Send + Sync + 'async_trait, TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, I> + 'async_trait, Ctx: AuthorizationContext<DM, SC, TC>, Update<Self>: StorageAction<SC, I>, I: Send + Sync + 'async_trait, 'subject: 'async_trait, 'context: 'async_trait, 'input: 'async_trait, 'life0: 'async_trait + 'subject + 'context,
Query whether the subject is authorized to update the specified objects. If so, perform the action.
sourcefn try_update_one<'life0, 'async_trait, DM, SC, TC, I>(
ctx: &'life0 Ctx,
input: I
) -> Pin<Box<dyn Future<Output = Result<<<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, [I; 1]>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>where
Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait,
DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait,
SC: StorageClient + Send + Sync + 'async_trait,
TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, [I; 1]> + 'async_trait,
Ctx: AuthorizationContext<DM, SC, TC>,
Update<Self>: StorageAction<SC, [I; 1]>,
I: Send + Sync + 'async_trait,
<Update<Self> as StorageAction<SC, [I; 1]>>::Ok: IntoIterator,
<<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item: Send,
'subject: 'async_trait,
'context: 'async_trait,
'input: 'async_trait,
'life0: 'async_trait + 'subject + 'context,
fn try_update_one<'life0, 'async_trait, DM, SC, TC, I>( ctx: &'life0 Ctx, input: I ) -> Pin<Box<dyn Future<Output = Result<<<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item, ActionError<<DM as DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId>>::Error, <Update<Self> as StorageAction<SC, [I; 1]>>::Error, <TC as TransactionCache>::Error>>> + Send + 'async_trait>>where Self: AsStorage<<SC as StorageClient>::Backend> + 'async_trait, DM: DecisionMaker<<Ctx as AuthorizationContext<DM, SC, TC>>::Subject<'subject>, Update<Self>, Self, [I; 1], <Ctx as AuthorizationContext<DM, SC, TC>>::Context<'context>, SC::TransactionId> + Sync + 'async_trait, SC: StorageClient + Send + Sync + 'async_trait, TC: Send + Sync + TransactionCache + TransactionCacheAction<Update<Self>, SC, [I; 1]> + 'async_trait, Ctx: AuthorizationContext<DM, SC, TC>, Update<Self>: StorageAction<SC, [I; 1]>, I: Send + Sync + 'async_trait, <Update<Self> as StorageAction<SC, [I; 1]>>::Ok: IntoIterator, <<Update<Self> as StorageAction<SC, [I; 1]>>::Ok as IntoIterator>::Item: Send, 'subject: 'async_trait, 'context: 'async_trait, 'input: 'async_trait, 'life0: 'async_trait + 'subject + 'context,
Query whether the subject is authorized to update the specified object. If so, perform the action. Expects the return type of the storage action to implement IntoIterator.