docs: public void setPermissions(String userNameorApikey, EnumSet<Permissions> permissions) {
          assertNotEmpty(userNameorApikey, "userNameorApikey");
          assertNotEmpty(permissions, "permissions");
          final JsonArray jsonPermissions = new JsonArray();
          for (Permissions s : permissions) {
              final JsonPrimitive permission = new JsonPrimitive(s.toString());
              jsonPermissions.add(permission);
          }
  
          // get existing permissions
          JsonObject perms = getPermissionsObject();
  
          // now set back
          JsonElement elem = perms.get("cloudant");
          if (elem == null) {
              perms.addProperty("_id", "_security");
              elem = new JsonObject();
              perms.add("cloudant", elem);
          }
          elem.getAsJsonObject().add(userNameorApikey, jsonPermissions);
  
          HttpConnection put = Http.PUT(apiV2DBSecurityURI, "application/json");
          put.setRequestBody(client.getGson().toJson(perms));
          // CouchDbExceptions will be thrown for non-2XX cases
          client.couchDbClient.executeToResponse(put);
      }