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

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

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

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