code: function gatherStateMachineRestrictions (stateMachines, permissionModel) {
    // Grab restrictions from state machines
    // -------------------------------------
  
    const docTasks = []
  
    if (!stateMachines) {
      return docTasks
    }
  
    for (const [name, stateMachine] of Object.entries(stateMachines)) {
      for (const restriction of (stateMachine.restrictions || [])) {
        restriction.stateMachineName = name
        docTasks.push({
          domain: 'stateMachineRestriction',
          docId: name + '_' + restriction.roleId,
          docSource: restriction,
          dao: permissionModel,
          docMaker: makePermissionDoc
        })
      }
    }
  
    return docTasks
  }
docs: gatherRoleTemplates