MCPcopy Create free account
hub / github.com/dfinity/orbit / assert_is_admin

Method assert_is_admin

core/control-panel/impl/src/core/call_context.rs:74–82  ·  view source on GitHub ↗

Checks if the caller is the asset canister.

(&self, scope: &str)

Source from the content-addressed store, hash-verified

72
73 /// Checks if the caller is the asset canister.
74 pub fn assert_is_admin(&self, scope: &str) -> Result<(), CanisterError> {
75 if !self.is_admin() {
76 return Err(CanisterError::Forbidden {
77 method: scope.to_string(),
78 });
79 }
80
81 Ok(())
82 }
83}

Callers

nothing calls this directly

Calls 1

is_adminMethod · 0.80

Tested by

no test coverage detected