On 03/13/2013 04:40 PM, Craig Ringer wrote: > Hi all > > I've noticed that the WhoBelongToGroups method of user search class > RT::Users unconditionally calls LimitToPrivileged, making it useless > for when you want to find both privileged and unprivileged users, or > when you want to find only unprivileged users where you've already > called LimitToUnprivileged . This behaviour isn't documented and > there's a comment: > > # Unprivileged users can't be granted real system rights. > # is this really the right thing to be saying? > $self->LimitToPrivileged();
BTW, I'm about to put up another extension that needs the behaviour in the patch. If I want to make it run on unpatched RT for easier distribution and installation how would you recommend doing this? I surely don't want to distribute a Users_Local.pm in my extension. I think I could hot-insert the method into RT::Users with something like: { package RT::Users; sub WhoBelongToGroupsIncludingPrivileged { # .... } } in my module. It doesn't have to be visible to other modules, so it'd essentially be a method of RT::Users that's private to my extension. Is this a sane approach? My Perl is still a bit rusty, so I wanted to check before putting anything out in the wild. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
-- RT training in Amsterdam, March 20-21: http://bestpractical.com/services/training.html Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T