summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Token.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-07-28 16:59:55 +0200
committerDavid Lawrence <dkl@mozilla.com>2015-07-28 16:59:55 +0200
commitd5c1c6f8c6ce9ae4a7c425a57d5e289c8aec84e7 (patch)
tree446f47d464132aeb1ff2e80083afba49fcffd878 /Bugzilla/Token.pm
parent2d96c58a0c746df107b4ca85255b360481c68e89 (diff)
downloadbugzilla-d5c1c6f8c6ce9ae4a7c425a57d5e289c8aec84e7.tar.gz
bugzilla-d5c1c6f8c6ce9ae4a7c425a57d5e289c8aec84e7.tar.xz
Bug 1163399: Autocompletion no longer works when impersonating a user
r=LpSolit,a=simon
Diffstat (limited to 'Bugzilla/Token.pm')
-rw-r--r--Bugzilla/Token.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index c43ba9f07..1f8e7bc17 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -37,8 +37,9 @@ use parent qw(Exporter);
sub issue_api_token {
# Generates a random token, adds it to the tokens table if one does not
# already exist, and returns the token to the caller.
- my $dbh = Bugzilla->dbh;
- my $user = Bugzilla->user;
+ my $dbh = Bugzilla->dbh;
+ # Allow certain UI components to work if impersonating another user.
+ my $user = Bugzilla->sudoer || Bugzilla->user;
my ($token) = $dbh->selectrow_array("
SELECT token FROM tokens
WHERE userid = ? AND tokentype = 'api_token'