Skip to main content

only_admin

Attribute Macro only_admin 

Source
#[only_admin]
Expand description

A procedural macro that retrieves the admin from storage and requires authorization from the admin before executing the function body.

ยงUsage

#[only_admin]
pub fn restricted_function(e: &Env, other_param: u32) {
    // Function body
}

This will expand to:

pub fn restricted_function(e: &Env, other_param: u32) {
    stellar_access::access_control::enforce_admin_auth(e);
    // Function body
}