code: function buildIndex (resourceType, permissions, inheritedBy) {
    const index = { }
  
    const resourceTypeName = `${resourceType}Name`
    for (const permission of permissions) {
      for (const allow of permission.allows) {
        const key = [
          resourceType,
          permission[resourceTypeName],
          allow
        ].join('.')
  
        const roleList = dottie.get(index, key) || []
        const inheritList = inheritedBy[permission.roleId] || []
  
        roleList.push(...inheritList)
  
        dottie.set(index, key, roleList)
      }
    }
  
    return index
  }
docs: class RbacIndex