How to create a revocable function to grant/revoke access to any other function?