Commit fb4f6f7b authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1232190: FlagType.create should require the user to be logged in

r/a=dkl
parent b77d2178
...@@ -61,11 +61,9 @@ sub get { ...@@ -61,11 +61,9 @@ sub get {
sub create { sub create {
my ($self, $params) = @_; my ($self, $params) = @_;
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $dbh = Bugzilla->dbh; $user->in_group('editcomponents')
my $user = Bugzilla->user;
Bugzilla->user->in_group('editcomponents')
|| scalar(@{$user->get_products_by_permission('editcomponents')}) || scalar(@{$user->get_products_by_permission('editcomponents')})
|| ThrowUserError("auth_failure", { group => "editcomponents", || ThrowUserError("auth_failure", { group => "editcomponents",
action => "add", action => "add",
...@@ -121,11 +119,9 @@ sub create { ...@@ -121,11 +119,9 @@ sub create {
sub update { sub update {
my ($self, $params) = @_; my ($self, $params) = @_;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $user = Bugzilla->user; my $user = Bugzilla->login(LOGIN_REQUIRED);
Bugzilla->login(LOGIN_REQUIRED);
$user->in_group('editcomponents') $user->in_group('editcomponents')
|| scalar(@{$user->get_products_by_permission('editcomponents')}) || scalar(@{$user->get_products_by_permission('editcomponents')})
|| ThrowUserError("auth_failure", { group => "editcomponents", || ThrowUserError("auth_failure", { group => "editcomponents",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment