async getProfileRights(request) {
    const id = request.getId();

    const profile = await this.ask("core:security:profile:get", id);
    const rights = await profile.getRights();
    const hits = Object.keys(rights).reduce(
      (array, item) => array.concat(rights[item]),
      [],
    );

    return {
      hits,
      total: hits.length,
    };
  }
Given a profile id, returns the matching profile's rights as an array.

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