[Rt-commit] rt branch, 4.2/initialdata-cf-lookuptype, created. rt-4.1.13-43-gc1b359a

Alex Vandiver alexmv at bestpractical.com
Tue Jul 2 12:37:07 EDT 2013


The branch, 4.2/initialdata-cf-lookuptype has been created
        at  c1b359a108a79d39c002a6de75d08e2ed4bd0e68 (commit)

- Log -----------------------------------------------------------------
commit c1b359a108a79d39c002a6de75d08e2ed4bd0e68
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jul 2 12:33:07 2013 -0400

    Allow specification of the LookupType of the CF to assign rights to
    
    This is useful when there are multiple CFs with the same name applied to
    different types of objects.

diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index ef5fb20..4a79aee 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -304,6 +304,7 @@ granted.  This is B<different> than the user/group/role receiving the right.
 =item Granted on a custom field by name (or ID), potentially a global or queue
 
     CF => 'Name',
+    LookupType => 'RT::User',  # optional, in case you need to disambiguate
 
 =item Granted on a queue
 
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 46df34c..81f1b6e 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -971,6 +971,7 @@ sub InsertData {
             if ( $item->{'CF'} ) {
                 $object = RT::CustomField->new( RT->SystemUser );
                 my @columns = ( Name => $item->{'CF'} );
+                push @columns, LookupType => $item->{'LookupType'} if $item->{'LookupType'};
                 push @columns, Queue => $item->{'Queue'} if $item->{'Queue'} and not ref $item->{'Queue'};
                 my ($ok, $msg) = $object->LoadByName( @columns );
                 unless ( $ok ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list