[Rt-commit] [svn] r1684 - in rt/branches/3.3-TESTING: . lib/RT
jesse at pallas.eruditorum.org
jesse at pallas.eruditorum.org
Sat Oct 23 17:49:53 EDT 2004
Author: jesse
Date: Sat Oct 23 17:49:50 2004
New Revision: 1684
Modified:
rt/branches/3.3-TESTING/ (props changed)
rt/branches/3.3-TESTING/lib/RT/ACL_Overlay.pm
Log:
r6091 at tinbook: jesse | 2004-10-23T21:46:04.315427Z
Better checking for ACL queries on undefined objects (to avoid a warning).
Modified: rt/branches/3.3-TESTING/lib/RT/ACL_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ACL_Overlay.pm (original)
+++ rt/branches/3.3-TESTING/lib/RT/ACL_Overlay.pm Sat Oct 23 17:49:50 2004
@@ -86,12 +86,27 @@
sub LimitToObject {
my $self = shift;
- my $obj = shift;
- unless (defined($obj) && ref($obj) && UNIVERSAL::can($obj, 'id')) {
- return undef;
+ my $obj = shift;
+ unless ( defined($obj)
+ && ref($obj)
+ && UNIVERSAL::can( $obj, 'id' )
+ && $obj->id )
+ {
+ return undef;
}
- $self->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => ref($obj), ENTRYAGGREGATOR => 'OR');
- $self->Limit(FIELD => 'ObjectId', OPERATOR=> '=', VALUE => $obj->id, ENTRYAGGREGATOR => 'OR', QUOTEVALUE => 0);
+ $self->Limit(
+ FIELD => 'ObjectType',
+ OPERATOR => '=',
+ VALUE => ref($obj),
+ ENTRYAGGREGATOR => 'OR'
+ );
+ $self->Limit(
+ FIELD => 'ObjectId',
+ OPERATOR => '=',
+ VALUE => $obj->id,
+ ENTRYAGGREGATOR => 'OR',
+ QUOTEVALUE => 0
+ );
}
More information about the Rt-commit
mailing list