How can I know if the caller is the controller of the canister in the inspect function?

I know that I can fetch controllers with canister_status in Management canister, but this function is asynchronous and I must use await, but It’s not allowed in inspect.

Is it possible to get the controller of the container without async?


There is the is_controller function. Rust function, Motoko function

The perfect solution to my problem. Thank you .

1 Like