Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kitsonk opened this issue May 19, 2022 · 3 comments · Fixed by #25811
Closed

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

kitsonk opened this issue May 19, 2022 · 3 comments · Fixed by #25811
Labels
bug Something isn't working correctly public API related to "Deno" namespace in JS

Comments

@kitsonk
Copy link
Contributor

kitsonk commented May 19, 2022

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 kitsonk added bug Something isn't working correctly public API related to "Deno" namespace in JS labels May 19, 2022
@tom-sherman
Copy link

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
Copy link

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

@teleclimber
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly public API related to "Deno" namespace in JS
Projects
None yet
3 participants