static async getViews (req) {
    const user = req.settingUser;
    if (!user) { return { data: [], recordsTotal: 0, recordsFiltered: 0 }; }

    const roles = [...await user.getRoles()]; // es requires an array for terms search

    // only get views for setting user or shared
    const query = {
      query: {
        bool: {
          filter: [
            {
              bool: {
                should: [
                  { terms: { roles } }, // shared via user role
                  { terms: { editRoles: roles } }, // shared via user editRoles
                  { term: { users: user.userId } }, // shared via userId
                  { term: { user: user.userId } } // created by this user
                ]
              }
            }
          ]
        }
      },
      sort: {},
      from: req.query.start || 0,
      size: req.query.length || 50
    };

    if (req.query.all && roles.includes('arkimeAdmin')) {
      query.query.bool.filter = []; // remove sharing restrictions
    }

    query.sort[req.query.sort || 'name'] = {
      order: req.query.desc === 'true' ? 'desc' : 'asc'
    };

    if (req.query.searchTerm) {
      query.query.bool.filter.push({
        wildcard: { name: '*' + req.query.searchTerm + '*' }
      });
    }

    const { body: { hits: views } } = await Db.searchViews(query);

    delete query.sort;
    delete query.size;
    delete query.from;
    const { body: { count: total } } = await Db.numberOfViews(query);

    const results = views.hits.map((view) => {
      const id = view._id;
      const result = view._source;

      if ( // remove sensitive information for users this is shared with
        // (except creator, arkimeAdmin, and editors)
        user.userId !== result.user &&
        !user.hasRole('arkimeAdmin') &&
        !user.hasRole(result.editRoles)) {
        delete result.users;
        delete result.roles;
        delete result.editRoles;
      } else if (result.users) {
        // client expects a string
        result.users = result.users.join(',');
      }

      result.id = id;
      return result;
    });

    return { data: results, recordsTotal: views.total, recordsFiltered: total };
  }
Retrieves an Arkime views that a user can view.