Charter · API

resolvePrincipal

Returns the set of ids granted to a principal in one section: the union of the ids each of its roles resolves to. section defaults to actions. A server calls it when a user signs in; in the example Linus has the roles member and usher.

Charter
{
  member: ['programme', 'seats', 'me.*'],
  usher: ['programme', 'door.*'],
}
Action ids
[
  'welcome',
  'programme',
  'seats',
  'me.tickets',
  'me.pass',
  'door.list',
  'members',
  'takings',
  'settings',
]
Roles
['member', 'usher']
Resolved ids
[
  'programme',
  'seats',
  'me.tickets',
  'me.pass',
  'door.list',
]
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.