Trait CpiAuthentication

Source
pub trait CpiAuthentication<'info>:
    Bumps
    + Sized
    + WithStore<'info> {
    // Required methods
    fn authority(&self) -> AccountInfo<'info>;
    fn on_error(&self) -> Result<()>;

    // Provided method
    fn check_role_ctx(&self) -> CpiContext<'_, '_, '_, 'info, CheckRole<'info>> { ... }
}
Expand description

Accounts that can be used for authentication.

Required Methods§

Source

fn authority(&self) -> AccountInfo<'info>

Get the authority to check.

§Notes
  • authority should be a signer.
Source

fn on_error(&self) -> Result<()>

Callback on authentication error.

Provided Methods§

Source

fn check_role_ctx(&self) -> CpiContext<'_, '_, '_, 'info, CheckRole<'info>>

Get the cpi context for checking role or admin permission.

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§