Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/fix-referencing-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri: patch:bug
---

Fix missing `core:` in referenced commands in ACL error message
17 changes: 8 additions & 9 deletions crates/tauri/src/ipc/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ impl RuntimeAuthority {
)
}
} else {
let permission_error_detail = if let Some(manifest) = self
let permission_error_detail = if let Some((key, manifest)) = self
.acl
.get(key)
.or_else(|| self.acl.get(&format!("core:{key}")))
.get_key_value(key)
.or_else(|| self.acl.get_key_value(&format!("core:{key}")))
{
let mut permissions_referencing_command = Vec::new();

Expand All @@ -501,12 +501,12 @@ impl RuntimeAuthority {
permissions_referencing_command.sort();

let associated_permissions = permissions_referencing_command
.iter()
.map(|p| {
.into_iter()
.map(|permission| {
if key == APP_ACL_KEY {
p.to_string()
permission
} else {
format!("{key}:{p}")
format!("{key}:{permission}")
}
})
.collect::<Vec<_>>()
Expand All @@ -523,8 +523,7 @@ impl RuntimeAuthority {

if let Some(resolved_cmds) = command_matches {
format!(
"{command_pretty_name} not allowed on origin [{}]. Please create a capability that has this origin on the context field.\n\nFound matches for: {}\n\n{permission_error_detail}",
origin,
"{command_pretty_name} not allowed on origin [{origin}]. Please create a capability that has this origin on the context field.\n\nFound matches for: {}\n\n{permission_error_detail}",
resolved_cmds
.iter()
.map(|resolved| {
Expand Down