[Rt-commit] r15743 - rt/branches/3.999-DANGEROUS/lib/RT/Model
ruz at bestpractical.com
ruz at bestpractical.com
Wed Sep 3 18:29:46 EDT 2008
Author: ruz
Date: Wed Sep 3 18:29:45 2008
New Revision: 15743
Modified:
rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
Log:
* use check_read_rights in Trasnaction model instead of overriding _value
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm Wed Sep 3 18:29:45 2008
@@ -1001,31 +1001,6 @@
}
-=head2 _value
-
-Takes the name of a table column.
-Returns its value as a string, if the user passes an ACL check
-
-=cut
-
-sub _value {
- my $self = shift;
- my $field = shift;
-
- #if the field is public, return it.
- if ( $field eq 'object_type' ) {
- return $self->SUPER::_value($field);
- }
-
- unless ( $self->current_user_can_see ) {
- return undef;
- }
-
- return $self->SUPER::_value($field);
-}
-
-
-
=head2 current_user_has_right RIGHT
Calls $self->current_user->has_queue_right for the right passed in here.
@@ -1090,6 +1065,13 @@
return 1;
}
+sub check_read_rights {
+ my $self = shift;
+ my $field = shift;
+ return 1 if $field eq 'object_type';
+ return $self->current_user_can_see;
+}
+
sub ticket {
# XXX: too early for deprecation, a lot of usage
@@ -1293,4 +1275,5 @@
'cache_for_sec' => 6000,
};
}
+
1;
More information about the Rt-commit
mailing list