Support wildcard topic in mail permissions
topic: null in a permission entry now matches any topic, allowing broad grants without specifying a specific topic. set-mail-permission topic param is now optional; omitting it stores null (wildcard). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,11 +92,11 @@ export const actions = {
|
||||
params: [
|
||||
{ name: 'target_user', required: true, type: 'string' },
|
||||
{ name: 'to', required: true, type: 'string' },
|
||||
{ name: 'topic', required: true, type: 'string' },
|
||||
{ name: 'topic', required: false, type: 'string' },
|
||||
{ name: 'allow', required: true, type: 'boolean' },
|
||||
],
|
||||
policy: 'auto-accept',
|
||||
handler: ({ target_user, to, topic, allow }, { caller, users, mail_perm_store }) => {
|
||||
handler: ({ target_user, to, topic = null, allow }, { caller, users, mail_perm_store }) => {
|
||||
if (!check_can_approve(users, caller, target_user)) {
|
||||
throw new Error(`Not authorized to set mail permissions for '${target_user}'`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user