Skip to content
Tauri

Permission

Descriptions of explicit privileges of commands.

It can enable commands to be accessible in the frontend of the application.

If the scope is defined it can be used to fine grain control the access of individual or multiple commands.

Object Properties:

  • commands
  • description
  • identifier (required)
  • platforms
  • scope
  • version

commands

Commands

Allowed or denied commands when using this permission.

Default
{
"allow": [],
"deny": []
}

description

string | null

Human-readable description of what the permission does.

identifier

string

A unique identifier for the permission.

platforms

Target[] | null

Target platforms this permission applies. By default all platforms are affected by this permission.

scope

Scopes

Allowed or denied scoped when using this permission.

version

integer | null minimum of 1, formatted as uint64

The version of the permission.

Definitions

Commands

Allowed and denied commands inside a permission.

If two commands clash inside of allow and deny, it should be denied by default.

Object Properties:

  • allow
  • deny
allow

string[]

Allowed command.

Default: []

deny

string[]

Denied command, which takes priority.

Default: []

Number

Any of the following:

  • integer formatted as int64 Represents an [i64].
  • number formatted as double Represents a [f64].

A valid ACL number.

Scopes

A restriction of the command/endpoint functionality.

It can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.

The scope is passed to the command and handled/enforced by the command itself.

Object Properties:

  • allow
  • deny
allow

Value[] | null

Data that defines what is allowed by the scope.

deny

Value[] | null

Data that defines what is denied by the scope.

Target

One of the following:

  • "macOS" MacOS.
  • "windows" Windows.
  • "linux" Linux.
  • "android" Android.
  • "iOS" iOS.

Platform target.

Value

Any of the following:

  • null Represents a null JSON value.
  • boolean Represents a [bool].
  • Number Represents a valid ACL [Number].
  • string Represents a [String].
  • Value[] Represents a list of other [Value]s.
  • Represents a map of [String] keys to [Value]s. Allows additional properties: Value

All supported ACL values.


© 2024 Tauri Contributors. CC-BY / MIT