Moss · Layout variants

Variant granted to a role

A layout variant is another layout for an existing action, granted to a role in the charter’s layouts section. The shell a server builds for somebody has the variant they hold in place of the action’s layout, and anyone granted none is drawn the base layout. Example: manager is granted programme.takings, which also shows each night’s takings, and only the manager’s page shows them.

Manager role
{
  manager: {
    extends: ['usher'],
    actions: { allow: ['*'], deny: ['welcome', 'me.*'] },
    data: ['*.read'],
    layouts: ['programme.takings'],
  },
}
Variant
{
  'programme.takings': {
    action: 'programme',
    layout: {
      component: 'Stack',
      children: [
        { component: 'Text', children: 'programme' },
        { component: 'Text', children: 'what each night took' },
      ],
    },
  },
}
Programme as drawn per person
grace
  programme
linus
  programme
manager
  programme
  what each night took
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.