Commit 0693b078 authored by Leigh Stoller's avatar Leigh Stoller

Minor changes to allow STUDLY users to use adminonly aggregates.

parent 24acc12d
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2008-2018 University of Utah and the Flux Group. # Copyright (c) 2008-2019 University of Utah and the Flux Group.
# #
# {{{GENIPUBLIC-LICENSE # {{{GENIPUBLIC-LICENSE
# #
...@@ -885,7 +885,8 @@ foreach my $aggregate_urn (@aggregate_urns) { ...@@ -885,7 +885,8 @@ foreach my $aggregate_urn (@aggregate_urns) {
} }
} }
if ($aptaggregate->adminonly() && if ($aptaggregate->adminonly() &&
!(defined($this_user) && $this_user->IsAdmin())) { !(defined($this_user) &&
($this_user->IsAdmin() || $this_user->stud()))) {
$slice->Delete(); $slice->Delete();
$instance->Delete(); $instance->Delete();
UserError("Only administrators may use the $aggregate_name cluster."); UserError("Only administrators may use the $aggregate_name cluster.");
......
<?php <?php
# #
# Copyright (c) 2000-2018 University of Utah and the Flux Group. # Copyright (c) 2000-2019 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -399,6 +399,8 @@ function SPITFORM($formfields, $newuser, $errors) ...@@ -399,6 +399,8 @@ function SPITFORM($formfields, $newuser, $errors)
echo " window.CANCOPY = $cancopy;\n"; echo " window.CANCOPY = $cancopy;\n";
$isadmin = (isset($this_user) && ISADMIN() ? 1 : 0); $isadmin = (isset($this_user) && ISADMIN() ? 1 : 0);
echo " window.ISADMIN = $isadmin;\n"; echo " window.ISADMIN = $isadmin;\n";
$isstud = (isset($this_user) && STUDLY() ? 1 : 0);
echo " window.ISSTUD = $isstud;\n";
$multisite = (isset($this_user) && $ISCLOUD ? 1 : 0); $multisite = (isset($this_user) && $ISCLOUD ? 1 : 0);
echo " window.MULTISITE = $multisite;\n"; echo " window.MULTISITE = $multisite;\n";
$doconstraints = $TBMAINSITE; $doconstraints = $TBMAINSITE;
......
...@@ -2344,7 +2344,7 @@ $(function () ...@@ -2344,7 +2344,7 @@ $(function ()
break; break;
} }
} }
if (found || isadmin) if (found || isadmin || window.ISSTUD)
{ {
$(this).prop('disabled', false); $(this).prop('disabled', false);
if (allowed.length == 1) { if (allowed.length == 1) {
......
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