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

fix(build): app ACL should be empty if no permissions are defined #9024

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions core/tauri-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,17 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
manifest::check(&config, &mut manifest)?;

let mut acl_manifests = acl::get_manifests_from_plugins()?;
acl_manifests.insert(
APP_ACL_KEY.into(),
acl::app_manifest_permissions(
&out_dir,
attributes.app_manifest,
&attributes.inlined_plugins,
)?,
);
let app_manifest = acl::app_manifest_permissions(
&out_dir,
attributes.app_manifest,
&attributes.inlined_plugins,
)?;
if app_manifest.default_permission.is_some()
|| !app_manifest.permission_sets.is_empty()
|| !app_manifest.permissions.is_empty()
{
acl_manifests.insert(APP_ACL_KEY.into(), app_manifest);
}
acl_manifests.extend(acl::inline_plugins(&out_dir, attributes.inlined_plugins)?);

std::fs::write(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# Permissions

## allow-ping

Enables the ping command without any pre-configured scope.

## deny-ping

Denies the ping command without any pre-configured scope.

## global-scope

Sets a global scope.

## allow-ping-scoped

Enables the ping command with a test scope.

| Permission | Description |
|------|-----|
|`allow-ping`|Enables the ping command without any pre-configured scope.|
|`deny-ping`|Denies the ping command without any pre-configured scope.|
|`global-scope`|Sets a global scope.|
|`allow-ping-scoped`|Enables the ping command with a test scope.|