mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:57:16 +00:00
fix(core): missing core: in referenced commands (#13150)
This commit is contained in:
parent
ad3fd3890f
commit
0d39ff6b09
5
.changes/fix-referencing-command.md
Normal file
5
.changes/fix-referencing-command.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
tauri: patch:bug
|
||||
---
|
||||
|
||||
Fix missing `core:` in referenced commands in ACL error message
|
||||
@ -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();
|
||||
|
||||
@ -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<_>>()
|
||||
@ -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| {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user