Skip to content

Commit 990e0fe

Browse files
committed
fix(core): missing core: in referenced commands
1 parent c71755f commit 990e0fe

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.changes/fix-referencing-command.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri: patch:bug
3+
---
4+
5+
Fix missing `core:` in referenced commands in ACL error message

crates/tauri/src/ipc/authority.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,10 @@ impl RuntimeAuthority {
475475
)
476476
}
477477
} else {
478-
let permission_error_detail = if let Some(manifest) = self
478+
let permission_error_detail = if let Some((key, manifest)) = self
479479
.acl
480-
.get(key)
481-
.or_else(|| self.acl.get(&format!("core:{key}")))
480+
.get_key_value(key)
481+
.or_else(|| self.acl.get_key_value(&format!("core:{key}")))
482482
{
483483
let mut permissions_referencing_command = Vec::new();
484484

@@ -501,12 +501,12 @@ impl RuntimeAuthority {
501501
permissions_referencing_command.sort();
502502

503503
let associated_permissions = permissions_referencing_command
504-
.iter()
505-
.map(|p| {
504+
.into_iter()
505+
.map(|permission| {
506506
if key == APP_ACL_KEY {
507-
p.to_string()
507+
permission
508508
} else {
509-
format!("{key}:{p}")
509+
format!("{key}:{permission}")
510510
}
511511
})
512512
.collect::<Vec<_>>()
@@ -523,8 +523,7 @@ impl RuntimeAuthority {
523523

524524
if let Some(resolved_cmds) = command_matches {
525525
format!(
526-
"{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}",
527-
origin,
526+
"{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}",
528527
resolved_cmds
529528
.iter()
530529
.map(|resolved| {

0 commit comments

Comments
 (0)