All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit a66d9a3e authored by Leigh B Stoller's avatar Leigh B 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