Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel
Re: Getting Custom Fields for a User
 

Index | Next | Previous | View Flat


leefm40 at yahoo

Apr 27, 2012, 11:38 AM


Views: 1030
Permalink
Re: Getting Custom Fields for a User [In reply to]

On 16/04/2012 15:25, Ruslan Zakirov wrote:
>
> If you have user object then you can just call my $cfs = $user->CustomFIelds;.
> You can take a look at CustomFIelds method in lib/RT/Record.pm.
>
> Even if you don't have user object then create one:
>
> my $cfs = RT::User->new( RT->SystemUser )->CustomFields;
>
> Use $session{CurrentUser} instead of SystemUser if it's web interface and
> you want to respect ACLs.


Hi Ruslan,

Thanks for that. Looking at the perldoc for User.pm doesn't give any
mention of that but I guess it's inherited from Record.pm

Think I've sussed out the problem, I was trying to run this as a none
privileged user but it didn't have access to SeeCustomFields based on
the code in CustomFields->Next:

return $self->Next unless $CF->CurrentUserHasRight('SeeCustomField');

I tried granting the SeeCustomField and ModifyCustomField rights on the
specific customer queue but that still didn't make the fields appear.

In the end I granted those two rights onto the global unprivileged group
which has made the fields appear but it seems a bit too open to me.

Eventually I think applying those rights to the specific custom field
has given what I needed.

Would this generally be the right way to do it?

Thanks again

Lee
--------
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Subject User Time
Getting Custom Fields for a User leefm40 at yahoo Apr 15, 2012, 11:59 AM
    Re: Getting Custom Fields for a User trs at bestpractical Apr 15, 2012, 12:07 PM
        Re: Getting Custom Fields for a User leefm40 at yahoo Apr 15, 2012, 12:21 PM
            Re: Getting Custom Fields for a User ruz at bestpractical Apr 16, 2012, 7:25 AM
    Re: Getting Custom Fields for a User leefm40 at yahoo Apr 16, 2012, 12:29 PM
        Re: Getting Custom Fields for a User ruz at bestpractical Apr 16, 2012, 2:15 PM
    Re: Getting Custom Fields for a User leefm40 at yahoo Apr 21, 2012, 2:30 PM
        Re: Getting Custom Fields for a User ruslan.zakirov at gmail Apr 21, 2012, 8:53 PM
    Re: Getting Custom Fields for a User leefm40 at yahoo Apr 22, 2012, 2:52 PM
        Re: Getting Custom Fields for a User falcone at bestpractical Apr 24, 2012, 9:38 AM
    Re: Getting Custom Fields for a User leefm40 at yahoo Apr 27, 2012, 11:38 AM
        Re: Getting Custom Fields for a User leefm40 at yahoo Apr 27, 2012, 11:41 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.