[Rt-devel] hooking into user creation

Joby Walker joby at u.washington.edu
Tue Jul 17 16:17:20 EDT 2007


Nicholas Clark wrote:
> On Tue, Jul 17, 2007 at 10:43:37AM -0700, Joby Walker wrote:
>> Nicholas Clark wrote:
> 
>>> That's somewhat icky too, as I'm also relying on the value of the custom
>>> field in quite a few other places to identify the company that the user
>>> belongs to. (And get back to the group). So really both need to be set.
>>>
>>> Nicholas Clark
>> In our experience it is easier to just add columns to the User and or
>> Group tables than use Custom Fields.  It is *FAR* cleaner and faster.
> 
> That would require me to start tweaking parts of the UI to allow editing.
> So far using Custom Fields appears to be giving adequate performance, and
> for what I'm doing feels cleaner than changing lib/RT/User.pm etc
> 
> And I still don't think that it would solve this problem, as I would still
> need to find a way to add a trigger on user creation that adds them to a
> group, as I wish to continue using RT's standard ACL system for controlling
> ticket visibility.

True, but putting the hooks in local/lib/RT/User_Local.pm is simple, and
then you can override RT::User->create to do exactly what you want.
Adding a few UI elements to the Admin interface isn't hard either.

As for performance, it depends on the number of users/customfieldvalues
you have.  With 70,000+ users that adds up to a lot of
objectcustomfieldvalues records, and every SQL query you can avoid is a
gain.  If you have a small installation, then it may not matter.

Relying on the RT::Interface::Web methods is unreliable since it would
only impact changes that pass through those methods.  It is more
reliable to modify the actual object you wish to affect.


Joby Walker
C&C SSG, University of Washington





> 
> Nicholas Clark


More information about the Rt-devel mailing list