Complete the code to check read permission for a file.
const status = await Deno.permissions.query({ name: [1] });The permissions.query method checks if the program has the specified permission. Here, "read" is used to check read access.
Complete the code to request network access permission for example.com.
const status = await Deno.permissions.request({ name: "net", host: [1] });The host property expects the hostname without protocol. So "example.com" is correct.
Fix the error in the code to revoke write permission correctly.
const status = await Deno.permissions.[1]({ name: "write" });
request instead of revoke does not remove permissions.query only checks permission status.The revoke method removes a previously granted permission. Using request or query won't revoke permissions.
Fill both blanks to check if the program has read permission for a specific file path.
const status = await Deno.permissions.query({ name: [1], path: [2] });The name should be "read" to check read permission, and path is the file path string.
Fill all three blanks to request environment variable read permission for the variable 'HOME'.
const status = await Deno.permissions.request({ name: [1], variable: [2], [3]: true });To request environment variable permission, name is "env", variable is the variable name, and read set to true means read access.
