static async getCrons (req, res) {
    if (!req.settingUser) {
      return res.serverError(403, 'Unknown user');
    }

    const user = req.settingUser;
    if (user.settings === undefined) { user.settings = {}; }

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

    const query = {
      size: 1000,
      sort: { created: { order: 'asc' } },
      query: {
        bool: {
          must_not: [
            { ids: { values: ['primary-viewer'] } }
          ],
          filter: [
            {
              bool: {
                should: [
                  { terms: { roles } }, // shared via user role
                  { terms: { editRoles: roles } }, // shared via edit role
                  { term: { users: user.userId } }, // shared via userId
                  { term: { creator: user.userId } } // created by this user
                ]
              }
            }
          ]
        }
      }
    };

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

    Db.search('queries', 'query', query, (err, data) => {
      if (err || data.error) {
        console.log(`ERROR - ${req.method} /api/crons`, util.inspect(err || data.error, false, 50));
      }

      let queries = [];

      if (data && data.hits && data.hits.hits) {
        queries = data.hits.hits.map((item) => {
          const key = item._id;
          const result = item._source;

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

          result.key = key;
          return result;
        });
      }

      res.send(queries);
    });
  }
GET - /api/crons

Retrieves periodic queries a user can view.
@name /crons
@returns {ArkimeQuery[]} queries - A list of query objects.