Commit 3bf715b3 authored by Leigh Stoller's avatar Leigh Stoller

Let STUDLY() and OPSGUYS() set the skipvlans toggle.

parent 878b1c29
......@@ -1022,7 +1022,7 @@ class Experiment
</td>
</tr>\n";
if (ISADMIN()) {
if (ISADMIN() || STUDLY() || OPSGUY()) {
$thisflip = ($skipvlans ? 0 : 1);
$flipval = ($skipvlans ? "Yes" : "No");
echo "<tr>
......
......@@ -146,13 +146,23 @@ elseif ($type == "lockdown") {
$experiment->SetLockDown($value);
}
elseif ($type == "skipvlans") {
# must be admin
if (! $isadmin) {
# Must validate the pid,eid since we allow non-admins to do this.
if (! TBvalid_pid($pid)) {
PAGEARGERROR("Invalid characters in $pid");
}
if (! TBvalid_eid($eid)) {
PAGEARGERROR("Invalid characters in $eid");
}
if (! ($isadmin || STUDLY() || OPSGUY())) {
USERERROR("You do not have permission to toggle $type!", 1);
}
if (! ($experiment = Experiment::LookupByPidEid($pid, $eid))) {
PAGEARGERROR("Experiment $pid/$eid is not a valid experiment!");
}
if (!$isadmin &&
! TBMinTrust(TBGrpTrust($uid, $pid, $pid), $TBDB_TRUST_LOCALROOT)) {
USERERROR("You do not have permission to toggle $type!", 1);
}
$zapurl = CreateURL("showexp", $experiment);
$experiment->SetSkipVlans($value);
}
......
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