// we have to get the stored query without checking the user permissions.
// all query actions are blocked for all users. they are allowed to read the
// queries, only when executing them.
if (path != null) {
String purePath = RegistryUtils.getPureResourcePath(path);
if (systemRegistry.resourceExists(purePath)) {
query = systemRegistry.get(purePath);
// If no media type was specified, the query should not work at all.
// This is also used in the remote registry scenario, where we send '/' as the
// query path, when path is null.
if (query != null && (query.getMediaType() == null ||