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

Plugin give an optional reason why a permission is needed #3365

Open
Zykino opened this issue May 21, 2024 · 0 comments
Open

Plugin give an optional reason why a permission is needed #3365

Zykino opened this issue May 21, 2024 · 0 comments

Comments

@Zykino
Copy link
Contributor

Zykino commented May 21, 2024

The optional string would be to print a sort of table (if there is place).
I don’t have a screenshot of the permissions on hand but for the weather plugin I feel it would look like:

The plugin is requesting permissions:
WebRequest: to get the weather information online
WriteToStdin: to transfer the weather information to the CLI if you want to
OpenFiles
Give the permissions? (y/n)

In this example the OpenFiles did not have the optional "reason"/description string.

I would see the API changing more or less as follow:

struct RequestPermission {
  pub Type: PermissionType;
  pub Reason: Option<String>;
}

pub fn request_permission(permissions: &[RequestPermission])
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

1 participant