write xmlrpc function getAllGroups that is to be contributed to the upstream. Please refer to the following url for details on Bugzilla::RPC 2.18 functions mapped to upstream Bugzilla::WebService and for 2.18 xmlrpc functions sorted by percentage of calls: https://engineering.redhat.com/trac/bugzilla-3.0-rh/wiki/XmlrpcCrossComparison#a2.18xmlrpcfunctionssortedbypercentageofcalls
Currently in CVS and running on bz-web2-test. Worked 1 hour.
Reopening as this was never converted to 3.2.
Created attachment 320611 [details] Patch to re-enable bugzilla.getAllGroups and also adds Group.get 3.X API (v1) Attaching a patch that reenables the bugzilla.getAllGroups from 2.18 and uses Bugzilla::Group->get_all. Also added new Bugzilla::WebService::Group which essentially adds a similar function but uses the 3.X API and also allows for filtering group list by ids or names. Please review Dave
Created attachment 320613 [details] Patch to re-enable bugzilla.getAllGroups and also adds Group.get 3.X API (v2) Oops, left out needed changes to xmlrpc.cgi in the last patch. Submitting fixed patch for review.
Comment on attachment 320613 [details] Patch to re-enable bugzilla.getAllGroups and also adds Group.get 3.X API (v2) Hi Dave, Patch looks good to me tested it and it works fine, only few comments inline. > >Index: Bugzilla/WebService/Group.pm >=================================================================== >+=item B<Errors> >+ >+=over >+ >+=item 51 (Invalid Object) >+ >+A non existing group name was passed to the function, as a result no >+group object existed for that invalid name. >+ I think we can also add here an error for the case if the user is not in the creatgroups group as the following: =item 304 (Authorization Required) Logged-in users are not authorized to edit bugzilla groups as they are not members of the creategroups group in bugzilla. >+=back >+ >+=back >+ >+=back >+ >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >+sub getAllGroups { >+ my ($self, $username, $password) = @_; >+ >+ # Try to login if $username and $password provided. >+ xmlrpc_client_login($username, $password, LOGIN_REQUIRED); >+ >+ $logger->debug("Starting: $username"); >+ >+ Bugzilla->user->in_group('editusers') I think this should be Bugzilla->user->in_group('creategroups'); >+ || ThrowUserError("auth_failure", {group => "creategroups", >+ action => "edit", >+ object => "groups"}); >+ >
Thanks Noura. Committed to CVS.