Permissions class
Deno's permission management API.
The class which provides the interface for the {@linkcode Deno.permissions} global instance and is based on the web platform Permissions API, though some proposed parts of the API which are useful in a server side runtime context were removed or abandoned in the web platform specification which is why it was chosen to locate it in the {@linkcode Deno} namespace instead.
By default, if the stdin
/stdout
is TTY for the Deno CLI (meaning it can
send and receive text), then the CLI will prompt the user to grant
permission when an un-granted permission is requested. This behavior can
be changed by using the --no-prompt
command at startup. When prompting
the CLI will request the narrowest permission possible, potentially making
it annoying to the user. The permissions APIs allow the code author to
request a wider set of permissions at one time in order to provide a better
user experience.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
Object desc) → Future< PermissionStatus> -
Available on Permissions, provided by the Permissions$Typings extension
Resolves to the current status of a permission. -
querySync(
Object desc) → PermissionStatus -
Available on Permissions, provided by the Permissions$Typings extension
Returns the current status of a permission. -
request(
Object desc) → Future< PermissionStatus> -
Available on Permissions, provided by the Permissions$Typings extension
Requests the permission, and resolves to the state of the permission. -
requestSync(
Object desc) → PermissionStatus -
Available on Permissions, provided by the Permissions$Typings extension
Requests the permission, and returns the state of the permission. -
revoke(
Object desc) → Future< PermissionStatus> -
Available on Permissions, provided by the Permissions$Typings extension
Revokes a permission, and resolves to the state of the permission. -
revokeSync(
Object desc) → PermissionStatus -
Available on Permissions, provided by the Permissions$Typings extension
Revokes a permission, and returns the state of the permission. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited