mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
log(desktop): add log messages for shell permission check
Show more information in log if shell permission denied
This commit is contained in:
parent
b866967dda
commit
a075ccfcec
@ -47,7 +47,10 @@ async function verifyShellCmdPermission(
|
|||||||
if (requiredPermissions.includes(permission.permission)) {
|
if (requiredPermissions.includes(permission.permission)) {
|
||||||
for (const deny of permission.deny || []) {
|
for (const deny of permission.deny || []) {
|
||||||
if (deny.cmd && deny.cmd.program === program && matchRegexArgs(args, deny.cmd.args || [])) {
|
if (deny.cmd && deny.cmd.program === program && matchRegexArgs(args, deny.cmd.args || [])) {
|
||||||
return Promise.reject("Shell Command Permission Denied by deny rule")
|
console.warn("deny matched", deny)
|
||||||
|
return Promise.reject(
|
||||||
|
`Shell Command Permission Denied by deny rule: ${JSON.stringify(deny)}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const allow of permission.allow || []) {
|
for (const allow of permission.allow || []) {
|
||||||
@ -61,7 +64,11 @@ async function verifyShellCmdPermission(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.reject("Shell Command Permission Denied, no allow rule found")
|
console.warn("program", program)
|
||||||
|
console.warn("args", args)
|
||||||
|
console.warn("requiredPermissions", requiredPermissions)
|
||||||
|
console.warn("userPermissionScopes", userPermissionScopes)
|
||||||
|
return Promise.reject(`Shell Command Permission Denied, no allow rule found.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user