[Rt-commit] rt branch, 4.2/initialdata-cf-acl, created. rt-4.2.4-98-ge8be193
Alex Vandiver
alexmv at bestpractical.com
Tue Jun 3 16:49:59 EDT 2014
The branch, 4.2/initialdata-cf-acl has been created
at e8be193456ff45228480c97adaefc5352c1b78ef (commit)
- Log -----------------------------------------------------------------
commit 7eefc4a3a8577a2ed5724e489ab104404a7d5cef
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Tue Jun 3 16:43:07 2014 -0400
Partially revert 487df4d92f0dcc6fd197e60b99719fcbe979cbcc
Switching directly from Queue to ObjectId is not correct, as it fails to
provide the ObjectType/LookupType hint.
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 773e3c2..351478e 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -1058,7 +1058,7 @@ sub InsertData {
$object = RT::CustomField->new( RT->SystemUser );
my @columns = ( Name => $item->{'CF'} );
push @columns, LookupType => $item->{'LookupType'} if $item->{'LookupType'};
- push @columns, ObjectId => $item->{'Queue'} if $item->{'Queue'} and not ref $item->{'Queue'};
+ push @columns, Queue => $item->{'Queue'} if $item->{'Queue'} and not ref $item->{'Queue'};
my ($ok, $msg) = $object->LoadByName( @columns );
unless ( $ok ) {
RT->Logger->error("Unable to load CF ".$item->{CF}.": $msg");
commit e8be193456ff45228480c97adaefc5352c1b78ef
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Tue Jun 3 16:49:46 2014 -0400
Allow, and document, passing LookupType and ObjectId in @ACL
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index b2494bc..8e510dc 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -279,6 +279,14 @@ granted. This is B<different> than the user/group/role receiving the right.
CF => 'Name',
Queue => 'Name',
+=item Granted on a custom field applied to some other object
+
+ # This finds the CF named "Name" applied to Articles in the
+ # "Responses" class
+ CF => 'Name',
+ LookupType => RT::Article->CustomFieldLookupType,
+ ObjectId => 'Responses',
+
=item Granted on some other object (article Classes, etc)
ObjectType => 'RT::Class',
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 351478e..9c1158b 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -1058,6 +1058,7 @@ sub InsertData {
$object = RT::CustomField->new( RT->SystemUser );
my @columns = ( Name => $item->{'CF'} );
push @columns, LookupType => $item->{'LookupType'} if $item->{'LookupType'};
+ push @columns, ObjectId => $item->{'ObjectId'} if $item->{'ObjectId'};
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