summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2021-03-02 15:15:41 +1000
committerJeff Fearn <jfearn@redhat.com>2021-03-02 15:15:41 +1000
commitea94a04f94662946fb6c8034040cd80d23192185 (patch)
tree8ed8f86e192725dc6ff39a80681a52ecdd61ac76
parentBug 1932169 - Allow radius to be used for all redhat.com accounts (diff)
downloadbugzilla-ea94a04f94662946fb6c8034040cd80d23192185.tar.gz
bugzilla-ea94a04f94662946fb6c8034040cd80d23192185.tar.bz2
bugzilla-ea94a04f94662946fb6c8034040cd80d23192185.zip
Bug 1933938 - Only admins can terminate accounts with api_keys
Allow editusers to ban. Change-Id: I11c9aca3d8008c488db0449facc1474fae4b3220
-rw-r--r--Bugzilla/User/APIKey.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Bugzilla/User/APIKey.pm b/Bugzilla/User/APIKey.pm
index f267b31f1..1b6980fbf 100644
--- a/Bugzilla/User/APIKey.pm
+++ b/Bugzilla/User/APIKey.pm
@@ -16,6 +16,7 @@ use parent qw(Bugzilla::Object);
use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::Util qw(generate_random_password trim bz_crypt);
+use Bugzilla::Error;
#####################################################################
# Overriden Constants that are used as methods
@@ -89,9 +90,9 @@ sub set_revoked { $_[0]->set('revoked', $_[1]); }
sub set_banned {
my($self, $input) = @_;
- Bugzilla->user->in_group('admin')
+ Bugzilla->user->in_group('editusers')
|| ThrowUserError("auth_failure",
- {group => "admin", action => "run", object => "apikey"});
+ {group => "editusers", action => "run", object => "apikey"});
ThrowUserError("api_key_cannot_unban") if($self->banned() && !$input);
$self->set('banned', $input);