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 CpiAuthentication
s.
Provided Methods§
Sourcefn only(ctx: &Context<'_, '_, '_, '_, Self>, role: &str) -> Result<()>
fn only(ctx: &Context<'_, '_, '_, '_, Self>, role: &str) -> Result<()>
Check that the authority
has the given role
.
Sourcefn only_admin(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>
fn only_admin(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>
Check that the authority
is an admin.
Sourcefn only_market_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>
fn only_market_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>
Check that the authority
has the MARKET_KEEPER
role.
Sourcefn only_order_keeper(ctx: &Context<'_, '_, '_, '_, Self>) -> Result<()>
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.