Trait CpiAuthenticate

Source
pub trait CpiAuthenticate<'info>: CpiAuthentication<'info> {
    // Provided methods
    fn only(ctx: &Context<'_, '_, '_, '_, Self>, role: &str) -> Result<()> { ... }
    fn only_admin(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()> { ... }
    fn only_market_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()> { ... }
    fn only_order_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()> { ... }
}
Expand description

Provides access control utils for CpiAuthentications.

Provided Methods§

Source

fn only(ctx: &Context<'_, '_, '_, '_, Self>, role: &str) -> Result<()>

Check that the authority has the given role.

Source

fn only_admin(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>

Check that the authority is an admin.

Source

fn only_market_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>

Check that the authority has the MARKET_KEEPER role.

Source

fn only_order_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>

Check that the authority has the ORDER_KEEPER role.

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§

Source§

impl<'info, T> CpiAuthenticate<'info> for T
where T: CpiAuthentication<'info>,