Commit 307525de authored by Leigh Stoller's avatar Leigh Stoller

Fix permission check for subgroup experiments.

parent a76331ae
...@@ -621,10 +621,6 @@ if ($localuser) { ...@@ -621,10 +621,6 @@ if ($localuser) {
if (!defined($project)) { if (!defined($project)) {
fatal("Project provided does not exist"); fatal("Project provided does not exist");
} }
if (!$project->AccessCheck($emulab_user, TB_PROJECT_CREATEEXPT)) {
fatal("No permission to create experiments in project ".
$project->pid());
}
$pid = $project->pid(); $pid = $project->pid();
# Option subgroup. # Option subgroup.
...@@ -636,8 +632,16 @@ if ($localuser) { ...@@ -636,8 +632,16 @@ if ($localuser) {
if (!defined($group)) { if (!defined($group)) {
fatal("Group $val does not exist in project $pid"); fatal("Group $val does not exist in project $pid");
} }
if (!$group->AccessCheck($emulab_user, TB_PROJECT_CREATEEXPT)) {
UserError("No permission to create experiments in group ".
$group->pid() . "/" . $group->gid());
}
} }
else { else {
if (!$project->AccessCheck($emulab_user, TB_PROJECT_CREATEEXPT)) {
UserError("No permission to create experiments in project ".
$project->pid());
}
$group = $project->GetProjectGroup(); $group = $project->GetProjectGroup();
} }
$gid = $group->gid(); $gid = $group->gid();
......
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