Closed
Bug 548198
Opened 15 years ago
Closed 14 years ago
Add a method of limiting the User.get results by group id
Categories
(Bugzilla :: WebService, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.0
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
There are a few use cases where we'd want to be able to send a group ID to User.get and have "match" only return users who are in that group. (For example, doing autocomplete for flag requestees.)
Assignee | ||
Comment 1•15 years ago
|
||
Still needs some testing and POD, though it's basically complete and compiles.
Assignee: webservice → mkanat
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•14 years ago
|
||
pyrzak: You can set up flag requestees to use AJAX now, using this patch.
Attachment #428632 -
Attachment is obsolete: true
Attachment #451447 -
Flags: review?(dkl)
Comment 3•14 years ago
|
||
Comment on attachment 451447 [details] [diff] [review]
v1
>=== modified file 'Bugzilla/WebService/User.pm'
>
> if (Bugzilla->user->in_group('editusers')) {
>+ my $in_group = $self->_filter_users_by_group(
>+ \@user_objects, $params);
> @users =
> map {filter $params, {
> id => $self->type('int', $_->id),
>@@ -210,10 +215,12 @@
> can_login => $self->type('boolean', $_->is_disabled ? 0 : 1),
> email_enabled => $self->type('boolean', $_->email_enabled),
> login_denied_text => $self->type('string', $_->disabledtext),
>- }} @user_objects;
>+ }} @$in_group;
>
> }
> else {
>+ my $in_group = $self->_filter_users_by_group(
>+ \@user_objects, $params);
> @users =
> map {filter $params, {
> id => $self->type('int', $_->id),
>@@ -221,12 +228,39 @@
> name => $self->type('string', $_->login),
> email => $self->type('string', $_->email),
> can_login => $self->type('boolean', $_->is_disabled ? 0 : 1),
>- }} @user_objects;
>+ }} @$in_group;
> }
You can move the following outside of the id {} else {} section as it is duplicated:
>+ my $in_group = $self->_filter_users_by_group(
>+ \@user_objects, $params);
> __END__
>@@ -493,6 +527,14 @@
> addresses from Bugzilla, and also to enforce the user visibility
> restrictions that are implemented on some Bugzillas.)
>
>+=item C<group_ids> (array)
>+=item C<groups> (array)
You need a new line between these otherwise it looks like:
"group_ids" (array) =item "groups" (array)
Dave
Attachment #451447 -
Flags: review?(dkl) → review-
Assignee | ||
Comment 4•14 years ago
|
||
Ah, thanks for catching all that! :-)
Attachment #451447 -
Attachment is obsolete: true
Attachment #452097 -
Flags: review?(dkl)
Comment 5•14 years ago
|
||
Comment on attachment 452097 [details] [diff] [review]
v2
Looks good and works as expected. r=dkl
Attachment #452097 -
Flags: review?(dkl) → review+
Updated•14 years ago
|
Flags: approval?
Assignee | ||
Comment 6•14 years ago
|
||
Thanks, dkl! :-)
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/WebService/User.pm
Committed revision 7218.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: approval? → approval+
Resolution: --- → FIXED
Updated•12 years ago
|
Blocks: CVE-2012-4198
You need to log in
before you can comment on or make changes to this bug.
Description
•