[bugzilla-gnome-org-extensions] 4.4 migration: Update attachment_is_visible



commit a68d1b4b31921cec265cb2459b6e684a7470cabf
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Tue Nov 18 11:09:36 2014 +0100

    4.4 migration: Update attachment_is_visible

 lib/Util.pm |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/lib/Util.pm b/lib/Util.pm
index 230d398..cf10f08 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -30,10 +30,11 @@ our @EXPORT = qw(attachment_is_visible);
 # Checks if the current user can see an attachment
 # Based on code from attachment.cgi
 sub attachment_is_visible {
-    my $attachment = shift;
+    my ($attachment) = @_;
+    my $user = Bugzilla->user();
 
-    return (Bugzilla->user->can_see_bug($attachment->bug->id) &&
-            (!$attachment->isprivate ||
-             Bugzilla->user->id == $attachment->attacher->id ||
-             Bugzilla->user->is_insider));
+    return ($user->can_see_bug($attachment->bug()->id()) &&
+            (!$attachment->isprivate() ||
+             $user->id == $attachment->attacher()->id() ||
+             $user->is_insider()));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]