use constant PUBLIC_METHODS => qw(
create
+ delete
+ update
);
use constant CREATE_MAPPED_FIELDS => {
# To get the component objects for product/component combination
# first obtain the product object from the passed product name
foreach my $name_hash (@{$params->{names}}) {
- my $product = $user->can_admin_product($name_hash->{product});
+ my $product = $user->check_can_admin_product($name_hash->{product});
push @components, @{ Bugzilla::Component->match({
product_id => $product->id,
name => $name_hash->{component}
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",
sub delete {
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",
use constant PUBLIC_METHODS => qw(
create
+ delete
+ update
);
use constant CREATE_MAPPED_FIELDS => {
# To get the component objects for product/component combination
# first obtain the product object from the passed product name
foreach my $name_hash (@{$params->{names}}) {
- my $product = $user->can_admin_product($name_hash->{product});
+ my $product = $user->check_can_admin_product($name_hash->{product});
push @components, @{ Bugzilla::Component->match({
product_id => $product->id,
name => $name_hash->{component}
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",
sub delete {
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",