From e7f91fda704945c9722bd46633b60e409177ef22 Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Tue, 21 Nov 2006 18:56:27 +0000 Subject: [PATCH] Allow plan owner to delete a test case that only appears in plans she owns. git-svn-id: svn://10.0.0.236/trunk@215559 18797224-902f-48f8-a5cc-f745e15eee43 --- .../webtools/testopia/Bugzilla/Testopia/TestCase.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index eafbd809ade..5da61218177 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -1342,10 +1342,13 @@ sub candelete { return 0 unless $self->canedit && Param("allow-test-deletion"); return 1 if Bugzilla->user->in_group("admin"); - # Allow plan author to delete if this case is linked to one plan only. - return 1 if Bugzilla->user->id == @{$self->plans}[0]->author->id && - scalar(@{$self->plans}) == 1; - + # Allow plan author to delete if this case is linked only to plans she owns. + my $own_all = 1; + foreach my $plan (@{$self->plans}){ + $own_all == 0 if (Bugzilla->user->id != $plan->author->id); + } + return 1 if $own_all; + # Allow case author to delete if this case is not in any runs. return 1 if Bugzilla->user->id == $self->author->id && $self->get_caserun_count == 0;