Skip to content

feat(core): allow defining permissions for the app commands#9008

Merged
lucasfernog merged 10 commits intodevfrom
feat/app-permissions
Feb 28, 2024
Merged

feat(core): allow defining permissions for the app commands#9008
lucasfernog merged 10 commits intodevfrom
feat/app-permissions

Conversation

@lucasfernog
Copy link
Member

Current ACL only applies to plugin commands. This PR adds a mechanism to autogenerate permissions for the app commands - though it needs to be manually provided by the user :( - and also pull permission from a directory, similar to how plugin permissions work.

By default all app commands are still allowed, so if you do not use tauri_build::Attributes::app_manifest you're not affected by this change.

@lucasfernog lucasfernog requested a review from a team as a code owner February 27, 2024 17:57
@lucasfernog lucasfernog requested review from tweidinger and removed request for a team February 27, 2024 17:58
}
let mut acl_manifests = acl::get_manifests_from_plugins()?;
acl_manifests.insert(
"".into(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems sort of magical key and can be easily forgot about? we should add an explicit field or marker for it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, pushed

@lucasfernog lucasfernog merged commit 3657ad8 into dev Feb 28, 2024
@lucasfernog lucasfernog deleted the feat/app-permissions branch February 28, 2024 11:45
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 16, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 16, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 16, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 16, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 17, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.

Co-authored-by: SimonLaux <mobile.info@simonlaux.de>
WofWca added a commit to deltachat/deltachat-desktop that referenced this pull request Mar 17, 2025
[The Tauri's API example app](https://github.com/tauri-apps/tauri/blob/cde0ff7798a46712f69b34aab952209f45500fe9/examples/api/src-tauri/build.rs#L9-L21)
was used as a reference for the implementation of this commit.

This tauri-apps/tauri#9008 says:
> By default all app commands are still allowed,
> so if you do not use `tauri_build::Attributes::app_manifest`
> you're not affected by this change.

Tauri docs don't seem to say much about how to disable this
"allow all commands by default" thing.

I have tested this change and verified that commands
are not available in the HTML email viewer contents webview,
and that only the required ones are available in its header webview.

Note that the upcoming webxdc MR
(#4740)
will need to be adjusted
to specify the allowed commands for the webxdc app windows.

Co-authored-by: SimonLaux <mobile.info@simonlaux.de>
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

Successfully merging this pull request may close these issues.

2 participants