diff options
Diffstat (limited to 'Bugzilla/WebService/Component.pm')
-rw-r--r-- | Bugzilla/WebService/Component.pm | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/Bugzilla/WebService/Component.pm b/Bugzilla/WebService/Component.pm index 4d6723d8b..802f40c73 100644 --- a/Bugzilla/WebService/Component.pm +++ b/Bugzilla/WebService/Component.pm @@ -19,37 +19,36 @@ use Bugzilla::Error; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Util qw(translate params_to_objects validate); -use constant PUBLIC_METHODS => qw( - create +use constant PUBLIC_METHODS => qw( + create ); use constant MAPPED_FIELDS => { - default_assignee => 'initialowner', - default_qa_contact => 'initialqacontact', - default_cc => 'initial_cc', - is_open => 'isactive', + default_assignee => 'initialowner', + default_qa_contact => 'initialqacontact', + default_cc => 'initial_cc', + is_open => 'isactive', }; sub create { - my ($self, $params) = @_; + my ($self, $params) = @_; - my $user = Bugzilla->login(LOGIN_REQUIRED); + my $user = Bugzilla->login(LOGIN_REQUIRED); - $user->in_group('editcomponents') - || scalar @{ $user->get_products_by_permission('editcomponents') } - || ThrowUserError('auth_failure', { group => 'editcomponents', - action => 'edit', - object => 'components' }); + $user->in_group('editcomponents') + || scalar @{$user->get_products_by_permission('editcomponents')} + || ThrowUserError('auth_failure', + {group => 'editcomponents', action => 'edit', object => 'components'}); - my $product = $user->check_can_admin_product($params->{product}); + my $product = $user->check_can_admin_product($params->{product}); - # Translate the fields - my $values = translate($params, MAPPED_FIELDS); - $values->{product} = $product; + # Translate the fields + my $values = translate($params, MAPPED_FIELDS); + $values->{product} = $product; - # Create the component and return the newly created id. - my $component = Bugzilla::Component->create($values); - return { id => $self->type('int', $component->id) }; + # Create the component and return the newly created id. + my $component = Bugzilla::Component->create($values); + return {id => $self->type('int', $component->id)}; } 1; |