summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorReed Loden <reed@reedloden.com>2012-06-26 17:20:26 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-06-26 17:20:26 +0200
commit5b3ea4d476084d47c99e3d2e9d409fea84c16831 (patch)
tree88588a72c98dfc3cfdc3e4b37b196c3f48d31da6 /Bugzilla/Bug.pm
parenta4ef21ac8165538bf9cfe7adb7272fda4cece5d6 (diff)
downloadbugzilla-5b3ea4d476084d47c99e3d2e9d409fea84c16831.tar.gz
bugzilla-5b3ea4d476084d47c99e3d2e9d409fea84c16831.tar.xz
Bug 138546: Add a checkbox to add himself to the CC list when creating or editing an attachment
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm24
1 files changed, 12 insertions, 12 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 1bf5a11cd..3d9689aca 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3614,23 +3614,23 @@ sub user {
return {} if $self->{'error'};
my $user = Bugzilla->user;
-
my $prod_id = $self->{'product_id'};
- my $unknown_privileges = $user->in_group('editbugs', $prod_id);
- my $canedit = $unknown_privileges
- || $user->id == $self->{'assigned_to'}
- || (Bugzilla->params->{'useqacontact'}
- && $self->{'qa_contact'}
- && $user->id == $self->{'qa_contact'});
- my $canconfirm = $unknown_privileges
- || $user->in_group('canconfirm', $prod_id);
- my $isreporter = $user->id
- && $user->id == $self->{reporter_id};
+ my $editbugs = $user->in_group('editbugs', $prod_id);
+ my $is_reporter = $user->id == $self->{reporter_id} ? 1 : 0;
+ my $is_assignee = $user->id == $self->{'assigned_to'} ? 1 : 0;
+ my $is_qa_contact = Bugzilla->params->{'useqacontact'}
+ && $self->{'qa_contact'}
+ && $user->id == $self->{'qa_contact'} ? 1 : 0;
+
+ my $canedit = $editbugs || $is_assignee || $is_qa_contact;
+ my $canconfirm = $editbugs || $user->in_group('canconfirm', $prod_id);
+ my $has_any_role = $is_reporter || $is_assignee || $is_qa_contact;
$self->{'user'} = {canconfirm => $canconfirm,
canedit => $canedit,
- isreporter => $isreporter};
+ isreporter => $is_reporter,
+ has_any_role => $has_any_role};
return $self->{'user'};
}