Function check_role

Source
pub fn check_role(
    ctx: Context<'_, '_, '_, '_, CheckRole<'_>>,
    role: String,
) -> Result<bool>
Expand description

Check that the authority has the given role in the given store.

This instruction verifies if the authority has the specified role in the given store and returns a boolean result.

§Accounts

See the documentation for the accounts..

§Arguments

  • role: The name of the role to check for the authority.

§Returns

Returns true if the authority has the role, false otherwise.

§Errors

  • The authority must be a signer.
  • The store must be an initialized store account owned by the store program.
  • The role must exist and be enabled in the store’s role configuration.