]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1232190: FlagType.create should require the user to be logged in
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 18 Dec 2015 11:53:50 +0000 (12:53 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 18 Dec 2015 11:53:50 +0000 (12:53 +0100)
r/a=dkl

Bugzilla/WebService/FlagType.pm

index 9723d47358d1fce861d526f0d82eed0f145c126d..9d7cce0375a69bbb77a0b762f23a6e3861aae397 100644 (file)
@@ -61,11 +61,9 @@ sub get {
 
 sub create {
     my ($self, $params) = @_;
+    my $user = Bugzilla->login(LOGIN_REQUIRED);
 
-    my $dbh = Bugzilla->dbh;
-    my $user = Bugzilla->user;
-
-    Bugzilla->user->in_group('editcomponents')
+    $user->in_group('editcomponents')
         || scalar(@{$user->get_products_by_permission('editcomponents')})
         || ThrowUserError("auth_failure", { group => "editcomponents",
                                          action => "add",
@@ -121,11 +119,9 @@ sub create {
 
 sub update {
     my ($self, $params) = @_;
-
     my $dbh = Bugzilla->dbh;
-    my $user = Bugzilla->user;
+    my $user = Bugzilla->login(LOGIN_REQUIRED);
 
-    Bugzilla->login(LOGIN_REQUIRED);
     $user->in_group('editcomponents')
         || scalar(@{$user->get_products_by_permission('editcomponents')})
         || ThrowUserError("auth_failure", { group  => "editcomponents",