Commit 506a1197 authored by Leigh Stoller's avatar Leigh Stoller

Allow metadata to be downloaded for all datasets (even if not global).

The metadata does not have anything sensitive, and this is easier than
rolling it into the secure download path via the CM.
parent dabd70cf
<?php <?php
# #
# Copyright (c) 2003-2015 University of Utah and the Flux Group. # Copyright (c) 2003-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -53,9 +53,13 @@ if (! isset($image)) { ...@@ -53,9 +53,13 @@ if (! isset($image)) {
if ($image->noexport()) { if ($image->noexport()) {
SPITERROR(403, "This image is marked as export restricted"); SPITERROR(403, "This image is marked as export restricted");
} }
if (!$image->isglobal()) { # We need the dataset metadata, but spew *does* deny it if not global.
if (!$image->isglobal() && !$image->isdataset()) {
SPITERROR(403, "No permission to access image"); SPITERROR(403, "No permission to access image");
} }
if (!$image->released()) {
SPITERROR(403, "Not allowed to access unreleased images");
}
# Pass imageid:version to backend script if its a specific version request. # Pass imageid:version to backend script if its a specific version request.
$imagearg = ($image->image_uuid() == $uuid && is_null($version) ? $imagearg = ($image->image_uuid() == $uuid && is_null($version) ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment