_allowedIndexes(request, publicIndexes) {
    if (request.getUser() === null) {
      return publicIndexes;
    }

    const allowedIndexes = [];

    const promises = publicIndexes.map((index) => {
      const deleteIndexRequest = new Request(
        { action: "delete", controller: "index", index },
        request.context,
      );

      return request.context.user
        .isActionAllowed(deleteIndexRequest)
        .then((isAllowed) => {
          if (isAllowed) {
            allowedIndexes.push(index);
          }
        });
    });

    return Promise.all(promises).then(() => allowedIndexes);
  }
Returns a list of indexes allowed to be deleted by the user.

Returns entire list of public indexes when called from EmbeddedSDK

@param {Request} request
@param {String[]} publicIndexes - Public indexes list