summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-12-18 12:52:18 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2015-12-18 12:52:18 +0100
commitf9a3ffafb2ede01b80eb18d30521e03741f4f005 (patch)
tree1fb22b42dc766c6587d2b2e91fbef861eab1d001 /Bugzilla
parentfbd124bfc141db9a6ad8f7b4734f0db6f9da2f5f (diff)
downloadbugzilla-f9a3ffafb2ede01b80eb18d30521e03741f4f005.tar.gz
bugzilla-f9a3ffafb2ede01b80eb18d30521e03741f4f005.tar.xz
Bug 1232190: FlagType.create should require the user to be logged in
r=dkl
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/API/1_0/Resource/FlagType.pm10
-rw-r--r--Bugzilla/WebService/FlagType.pm10
2 files changed, 6 insertions, 14 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",
diff --git a/Bugzilla/WebService/FlagType.pm b/Bugzilla/WebService/FlagType.pm
index 9723d4735..9d7cce037 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",