Commit c2ecb473 authored by Leigh Stoller's avatar Leigh Stoller

Enable profile/image deletion for all users.

parent 96794781
......@@ -497,7 +497,7 @@ sub DoDeleteImage()
my $opt = ($impotent ? "-n" : "");
my $output =
emutil::ExecQuiet("$MANAGEPROFILE delete -- -k $opt $uuid");
emutil::ExecQuiet("$MANAGEPROFILE delete -k $opt $uuid");
print $output;
if ($?) {
fatal("Could not delete version $vers");
......
......@@ -1060,7 +1060,7 @@ sub DeleteProfile()
my $profile = APT_Profile->Lookup($ARGV[0]);
if (!defined($profile)) {
fatal("No such profile exists");
fatal("No such profile exists: " . $ARGV[0]);
}
if ($profile->isLocked()) {
$errmsg = "This profile has its nodelete flag set.";
......@@ -1071,7 +1071,8 @@ sub DeleteProfile()
goto uerror;
}
# For now, mere users do not see new image deletion stuff unless
# feature enabled.
# feature enabled.
if (0) {
if (! ($this_user->admin() || $this_user->stud())) {
my $project = Project->Lookup($profile->pid_idx());
if (! EmulabFeatures->FeatureEnabled("APT_ImageDeletion",
......@@ -1079,6 +1080,7 @@ sub DeleteProfile()
$keepimages = 1;
}
}
}
# If deleting the only version of a profile, then force $all.
if ($profile->VersionCount() == 1) {
......
......@@ -400,7 +400,7 @@ echo " <li class='divider'></li>
<li><a href='create-dataset.php'>Create Dataset</a></li>
<li><a href='user-dashboard.php#datasets'>
My Datasets</a></li>
<li><a href='images.php'>List Disk Images</a></li>
<li><a href='list-images.php'>My Disk Images</a></li>
</ul>
</li>
";
......
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