summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Server
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-10-09 19:56:44 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-10-09 19:56:44 +0200
commit3d8f65f7f13925438711856935a2e535583d5ead (patch)
treef9dc23449b8027d28c2a0a88bfe40b9eae90bef1 /Bugzilla/WebService/Server
parentaafa79dbed67514aede45f884572c30934854107 (diff)
downloadbugzilla-3d8f65f7f13925438711856935a2e535583d5ead.tar.gz
bugzilla-3d8f65f7f13925438711856935a2e535583d5ead.tar.xz
Bug 1079476: Backport upstream bug 1014345 and bug 658485 to bmo/4.2 to allow getting and updating groups
Diffstat (limited to 'Bugzilla/WebService/Server')
-rw-r--r--Bugzilla/WebService/Server/REST/Resources/Group.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server/REST/Resources/Group.pm b/Bugzilla/WebService/Server/REST/Resources/Group.pm
index 9200d609d..e61408753 100644
--- a/Bugzilla/WebService/Server/REST/Resources/Group.pm
+++ b/Bugzilla/WebService/Server/REST/Resources/Group.pm
@@ -9,6 +9,7 @@ package Bugzilla::WebService::Server::REST::Resources::Group;
use 5.10.1;
use strict;
+use warnings;
use Bugzilla::WebService::Constants;
use Bugzilla::WebService::Group;
@@ -20,12 +21,22 @@ BEGIN {
sub _rest_resources {
my $rest_resources = [
qr{^/group$}, {
+ GET => {
+ method => 'get'
+ },
POST => {
method => 'create',
success_code => STATUS_CREATED
}
},
qr{^/group/([^/]+)$}, {
+ GET => {
+ method => 'get',
+ params => sub {
+ my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names';
+ return { $param => [ $_[0] ] };
+ }
+ },
PUT => {
method => 'update',
params => sub {