[Rt-commit] [rtir] 06/13: Further doc cleanups in HasRight

Kevin Falcone falcone at bestpractical.com
Wed Apr 16 17:29:40 EDT 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch master
in repository rtir.

commit 3ec3478534c05a02a4fce78bad225b6a8c7e9b40
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Mar 26 18:40:36 2014 -0400

    Further doc cleanups in HasRight
---
 lib/RT/IR.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 1259272..35d36e3 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -764,7 +764,12 @@ if ( RT::IR->HasConstituency ) {
         my %args = @_;
 
         return $self->SUPER::HasRight(@_) unless $self->id;
+        # currently only obviously used so that one right can be checked
+        # on Incidents not Incidents - EDUNET during Constituency CF
+        # editing.
         return $self->SUPER::HasRight(@_) if $self->{'disable_constituency_right_check'};
+        # Not really convinced this is right, since it gets set on $ticket->QueueObj
+        # commit messages that add it are vague about why it was added.
         return $self->SUPER::HasRight(@_) if $self->{'_for_ticket'};
 
         my $name = $self->__Value('Name');
@@ -773,6 +778,8 @@ if ( RT::IR->HasConstituency ) {
 
         $args{'Principal'} ||= $self->CurrentUser->PrincipalObj;
 
+        # Avoid going to the database on every Queue->HasRight('ModifyCustomField') or any
+        # other Queue right, but in RTIR, CF rights checks at the Queue level are very heavy.
         my $equiv_objects;
         if ( $queue_cache->{$name} ) {
             $equiv_objects = $queue_cache->{$name};
@@ -783,7 +790,6 @@ if ( RT::IR->HasConstituency ) {
             $queue_cache->{$name} = $equiv_objects;
         }
 
-
         my $has_right = $args{'Principal'}->HasRight(
             %args,
             Object => $self,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list