deno icon indicating copy to clipboard operation
deno copied to clipboard

`Deno.permissions.request()` prompts even if `--no-prompt` set

Open kitsonk opened this issue 3 years ago • 2 comments

Calling Deno.permissions.request() will prompt the user for the permission if not already granted even when --no-prompt or NO_PROMPT is set, which seems wrong. In those cases, it should just deny un-granted permissions.

Ref: denoland/deno_emit#3 where deno_cache is using Deno.permissions.request() to ensure it has sufficient permissions to determine the DENO_DIR.

kitsonk avatar May 19 '22 03:05 kitsonk

Just want to clarify what should happen if Deno.permissions.request() is called when --no-prompt is set: the promise should reject with a PermissionDenied right?

tom-sherman avatar Sep 10 '22 22:09 tom-sherman

Ok I think I misunderstood, the linked PR instead just returns denied in this scenario.

tom-sherman avatar Sep 10 '22 23:09 tom-sherman

Confirming this is still happening with Deno version 1.39.3. Note that this is problematic when the script is run unattended! Thanks.

teleclimber avatar Jan 13 '24 00:01 teleclimber