Commit d5c1c6f8 authored by David Lawrence's avatar David Lawrence

Bug 1163399: Autocompletion no longer works when impersonating a user

r=LpSolit,a=simon
parent 2d96c58a
...@@ -37,8 +37,9 @@ use parent qw(Exporter); ...@@ -37,8 +37,9 @@ use parent qw(Exporter);
sub issue_api_token { sub issue_api_token {
# Generates a random token, adds it to the tokens table if one does not # Generates a random token, adds it to the tokens table if one does not
# already exist, and returns the token to the caller. # already exist, and returns the token to the caller.
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $user = Bugzilla->user; # Allow certain UI components to work if impersonating another user.
my $user = Bugzilla->sudoer || Bugzilla->user;
my ($token) = $dbh->selectrow_array(" my ($token) = $dbh->selectrow_array("
SELECT token FROM tokens SELECT token FROM tokens
WHERE userid = ? AND tokentype = 'api_token' WHERE userid = ? AND tokentype = 'api_token'
......
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