An example using the permissions API to grant and revoke an optional permission.
How to request a permission, catching error conditions from the request and querying the permissions API.