Charter · API
verifyCharter
Validates a charter against the ids of each section and returns a report with errors and warnings. It takes every existing id per section, because a pattern can only be checked against the ids that exist. Run it at boot, before any user signs in, and stop the boot if it reports errors.
{
member: ['programme', 'seats', 'me.*'],
manager: { allow: ['*'], deny: ['me.*', 'cloakroom'] },
}[ 'welcome', 'programme', 'seats', 'me.tickets', 'me.pass', 'door.list', 'members', 'takings', 'settings', ]
{
errors: [
{
rule: 'dead-deny',
detail: 'role "manager" denies "cloakroom" (actions) which matches nothing — silent means unprotected',
},
],
warnings: 0,
}Runs in this page on the installed package. The input and the expected output are defined by the example.