<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/13/2013 04:40 PM, Craig Ringer
wrote:<br>
</div>
<blockquote cite="mid:51403B76.80106@2ndquadrant.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi all<br>
<div class="moz-forward-container"> <br>
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:<br>
<br>
# Unprivileged users can't be granted real system rights.<br>
# is this really the right thing to be saying?<br>
$self->LimitToPrivileged();<br>
</div>
</blockquote>
<br>
BTW, I'm about to put up another extension that needs the behaviour
in the patch.<br>
<br>
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.<br>
<br>
I think I could hot-insert the method into RT::Users with something
like:<br>
<br>
{<br>
package RT::Users;<br>
sub WhoBelongToGroupsIncludingPrivileged {<br>
# ....<br>
}<br>
}<br>
<br>
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.<br>
<br>
Is this a sane approach? My Perl is still a bit rusty, so I wanted
to check before putting anything out in the wild.<br>
<br>
<pre class="moz-signature" cols="72">--
Craig Ringer <a class="moz-txt-link-freetext" href="http://www.2ndQuadrant.com/">http://www.2ndQuadrant.com/</a>
PostgreSQL Development, 24x7 Support, Training & Services</pre>
</body>
</html>