async searchRoles(request) {
    const from = request.getInteger("from", 0);
    const size = this._getSearchPageSize(request);
    const lang = request.getLangParam();
    const body = request.getBody({});

    if (body.controllers && body.query) {
      throw new BadRequestError(
        'You cannot specifify both "controllers" and "query". Prefer the usage of "query" property with a search query.',
      );
    }

    if (body.controllers) {
      // Type checking
      request.getBodyArray("controllers");
    }

    if (lang === "koncorde") {
      body.query = await this.translateKoncorde(body.query || {});
    }

    const response = await this.ask("core:security:role:search", body, {
      from,
      size,
    });

    response.hits = response.hits.map(formatProcessing.serializeRole);

    return response;
  }
Search for roles

@param {Request} request
@returns {Promise<Object>}