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

docs(features): add permissions to sql page #2160

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/content/docs/features/sql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,34 @@ Migrations are applied automatically when the plugin is initialized. The plugin
- **Version Control**: Each migration must have a unique version number. This is crucial for ensuring the migrations are applied in the correct order.
- **Idempotency**: Write migrations in a way that they can be safely re-run without causing errors or unintended consequences.
- **Testing**: Thoroughly test migrations to ensure they work as expected and do not compromise the integrity of your database.

## Permissions

By default all plugin commands are blocked and cannot be accessed.
You must define a list of permissions in your `capabilities` configuration.

See [Access Control List](/references/acl) for more information.

```json title="src-tauri/capabilities/main.json" ins={7-8}
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "main-capability",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"sql:allow-load",
"sql:allow-execute",
]
}
```

| Permission | Description |
|------|-----|
|`sql:allow-close`|Enables the close command without any pre-configured scope.|
|`sql:deny-close`|Denies the close command without any pre-configured scope.|
|`sql:allow-execute`|Enables the execute command without any pre-configured scope.|
|`sql:deny-execute`|Denies the execute command without any pre-configured scope.|
|`sql:allow-load`|Enables the load command without any pre-configured scope.|
|`sql:deny-load`|Denies the load command without any pre-configured scope.|
|`sql:allow-select`|Enables the select command without any pre-configured scope.|
|`sql:deny-select`|Denies the select command without any pre-configured scope.|
Loading