Moss · API

defineApp

Returns the app manifest it is given, unchanged, typed as NiscApp; validation runs later, when the server boots. It is the only Moss export an app file needs besides its artifacts. The actions in this example are stubs: an id and one line of text each.

Charter
{
  guest: {
    actions: ['welcome', 'programme'],
    data: ['shows.read'],
  },
  member: {
    actions: ['programme', 'seats', 'me.*'],
    data: [
      'shows.read',
      'bookings.*',
      'passes.read',
      'members.read',
    ],
    scoping: 'personal',
  },
  usher: {
    actions: ['programme', 'door.*'],
    data: ['shows.read', 'bookings.read', 'members.read'],
  },
  manager: {
    extends: ['usher'],
    actions: { allow: ['*'], deny: ['welcome', 'me.*'] },
    data: ['*.read'],
  },
}
Assignments
{
  grace: ['member'],
  linus: ['usher', 'member'],
  manager: ['manager'],
}
Action ids
[
  'welcome',
  'programme',
  'seats',
  'me.tickets',
  'me.pass',
  'door.list',
  'members',
  'takings',
  'settings',
]
Output identical to input
true
Output matches the expected value

Computed when this site was built, by the installed package, which does not run in a browser. The site’s checks recompute it on every change.