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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[suggestion] - Rework permissions feature #13517

Closed
Olyno opened this issue Jan 27, 2022 · 2 comments
Closed

[suggestion] - Rework permissions feature #13517

Olyno opened this issue Jan 27, 2022 · 2 comments

Comments

@Olyno
Copy link

Olyno commented Jan 27, 2022

Hi 馃憢馃徎

I have tried Deno several times, before version 1.0, and with the latest version. One obvious problem I see, and which I think is huge, is the permission system. Currently, when we run a script with Deno, we have to specify the different permissions we want using arguments like --allow-run, --allow-read.... or --all or -A in order to accept all permissions.
The point is that by allowing all permissions on a program, we expose ourselves to serious risk to the machine or the user, but out of "developer laziness", we don't want to have an execution line like:

deno run --allow-read --allow-net --allow-write --allow-env mod.ts

That's why I propose a new way of working. Arguments are still important, especially for everything CI. At the same time, for a better user experience, I can see something like:

deno run mod.ts
mod.ts needs the net permission. Do you allow it?
 - Yes
 - No
> Yes
mod.ts needs the write permission. Do you allow it?
 - Yes
 - No
> Yes

Once the developer has entered his preferences, they are cached, so that he doesn't have to specify them again.

An alternative would be to have a configuration file for this, specifically, add this possibility to the current configuration system.

I think a better developer experience at this level would bring more developers into the project, or at least interest a part of the community.

This is an open suggestion, and I would love to hear from the developers and the Deno team about this one.

@crowlKats
Copy link
Member

Deno does have a --prompt flag, which will prompt you when a permission required that is needed isnt given.
Regarding config file: #12763

@Olyno
Copy link
Author

Olyno commented Jan 27, 2022

Oh alright, @kitsonk already did an issue about it, thanks you for the issue reference, i'm closing this one because of duplicate.

@Olyno Olyno closed this as completed Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants