Commit a66d9a3e authored by Leigh Stoller's avatar Leigh Stoller

Add admin check when gathering the list of aggregates that support

reservations and datasets; if the aggregate is marked as adminonly,
then user must be red-dot.
parent 842d4c73
......@@ -84,6 +84,7 @@ class Aggregate
function abbreviation() { return $this->field('abbreviation'); }
function weburl() { return $this->field('weburl'); }
function disabled() { return $this->field('disabled'); }
function adminonly() { return $this->field('adminonly'); }
function has_datasets() { return $this->field('has_datasets'); }
function reservations() { return $this->field('reservations'); }
function isfederate() { return $this->field('isfederate'); }
......@@ -175,6 +176,9 @@ class Aggregate
TBERROR("Aggregate::SupportsDatasetsList: ".
"Could not load aggregate $urn!", 1);
}
if ($aggregate->adminonly() && !(ISADMIN() || STUDLY())) {
continue;
}
$result[] = $aggregate;
}
return $result;
......@@ -200,6 +204,9 @@ class Aggregate
TBERROR("Aggregate::SupportsReservations: ".
"Could not load aggregate $urn!", 1);
}
if ($aggregate->adminonly() && !(ISADMIN() || STUDLY())) {
continue;
}
$result[] = $aggregate;
}
return $result;
......
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