Checks if the caller is the asset canister.
(&self, scope: &str)
| 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 | } |