diff options
Diffstat (limited to 'Bugzilla/API')
-rw-r--r-- | Bugzilla/API/1_0/Resource/FlagType.pm | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Bugzilla/API/1_0/Resource/FlagType.pm b/Bugzilla/API/1_0/Resource/FlagType.pm index 702b4d4ec..969a59532 100644 --- a/Bugzilla/API/1_0/Resource/FlagType.pm +++ b/Bugzilla/API/1_0/Resource/FlagType.pm @@ -114,11 +114,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", @@ -174,11 +172,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", |