From: Frédéric Buclin Date: Fri, 18 Dec 2015 11:53:50 +0000 (+0100) Subject: Bug 1232190: FlagType.create should require the user to be logged in X-Git-Tag: release-5.0.2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4f6f7b1574be030d7f592be91771905d00a620;p=thirdparty%2Fbugzilla.git Bug 1232190: FlagType.create should require the user to be logged in r/a=dkl --- diff --git a/Bugzilla/WebService/FlagType.pm b/Bugzilla/WebService/FlagType.pm index 9723d47358..9d7cce0375 100644 --- a/Bugzilla/WebService/FlagType.pm +++ b/Bugzilla/WebService/FlagType.pm @@ -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",