[Rt-commit] rt branch, 4.2/queue-cache, created. rt-4.1.5-245-g3283818

Thomas Sibley trs at bestpractical.com
Wed Jan 9 19:19:54 EST 2013


The branch, 4.2/queue-cache has been created
        at  328381817a33de754752615ef52264e762b4a6cb (commit)

- Log -----------------------------------------------------------------
commit cfa84a5003ff4c46d6b09a29447d5bdb38be4aaf
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 9 16:08:36 2013 -0800

    Only bust the queue cache if the grant/revoke succeeds
    
    For consistency with whatever we pulled out of the database, compare the
    right name to the record objects rather than the passed in argument.
    This ensures the right name is properly canonicalized.

diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index 450d89b..084737e 100644
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -176,16 +176,19 @@ sub GrantRight {
 
     my $type = $self->_GetPrincipalTypeForACL();
 
-    RT->System->QueueCacheNeedsUpdate(1) if $args{'Right'} eq 'SeeQueue';
-
     # If it's a user, we really want to grant the right to their 
     # user equivalence group
-    return $ace->Create(
+    my ($id, $msg) = $ace->Create(
         RightName     => $args{'Right'},
         Object        => $args{'Object'},
         PrincipalType => $type,
         PrincipalId   => $self->Id,
     );
+
+    RT->System->QueueCacheNeedsUpdate(1)
+        if $id and $ace->RightName eq 'SeeQueue';
+
+    return ($id, $msg);
 }
 
 
@@ -229,9 +232,15 @@ sub RevokeRight {
         return (1);
     }
 
-    RT->System->QueueCacheNeedsUpdate(1) if $args{'Right'} eq 'SeeQueue';
     return ($status, $msg) unless $status;
-    return $ace->Delete;
+
+    my $right = $ace->RightName;
+    ($status, $msg) = $ace->Delete;
+
+    RT->System->QueueCacheNeedsUpdate(1)
+        if $status and $right eq 'SeeQueue';
+
+    return ($status, $msg);
 }
 
 

commit e544af18440dfc292ada97025f407ef4510f2d9e
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 9 15:48:55 2013 -0800

    Bust the queue cache when CreateTicket is granted/revoked
    
    The default /Elements/SelectQueue invocation checks CreateTicket on each
    queue, so the cache may be stale if we don't bust on CreateTicket too.
    
    At this time, no other rights are actually checked through invocations
    of SelectQueue.  If they were, we'd have to bust the cache on those too.

diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index 084737e..034e7af 100644
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -186,7 +186,7 @@ sub GrantRight {
     );
 
     RT->System->QueueCacheNeedsUpdate(1)
-        if $id and $ace->RightName eq 'SeeQueue';
+        if $id and grep { $ace->RightName eq $_ } qw(SeeQueue CreateTicket);
 
     return ($id, $msg);
 }
@@ -238,7 +238,7 @@ sub RevokeRight {
     ($status, $msg) = $ace->Delete;
 
     RT->System->QueueCacheNeedsUpdate(1)
-        if $status and $right eq 'SeeQueue';
+        if $status and grep { $right eq $_ } qw(SeeQueue CreateTicket);
 
     return ($status, $msg);
 }

commit 5edd921977fa24ef782fbe6504c020dab49903bf
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 9 15:51:03 2013 -0800

    Remove misleading ShowTicket rights check in search queue selector
    
    /Elements/SelectQueue only uses CheckQueueRight if ShowAllQueues is
    false; by default it is true, however, so the ShowTicket right was never
    checked when generating the queue list for the query builder.  This has
    been true since the ACL check was introduced in 11195d4.
    
    In fact, checking the ShowTicket right would incorrectly hide queues for
    which the current user has ShowTicket via Requestor or another role, but
    not globally on the queue.  The ShowTicket right properly belongs at the
    individual ticket level, and should not be used for the queue list.

diff --git a/share/html/Search/Elements/PickBasics b/share/html/Search/Elements/PickBasics
index 80b5349..21f955f 100644
--- a/share/html/Search/Elements/PickBasics
+++ b/share/html/Search/Elements/PickBasics
@@ -89,7 +89,7 @@ my @lines = (
         Value => {
             Type => 'component',
             Path => '/Elements/SelectQueue',
-            Arguments => { NamedValues => 1, CheckQueueRight => 'ShowTicket' },
+            Arguments => { NamedValues => 1, },
         },
     },
     {

commit 328381817a33de754752615ef52264e762b4a6cb
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 9 15:54:26 2013 -0800

    Remove unused arguments from SelectLang, mistakenly copied from SelectQueue

diff --git a/share/html/Elements/SelectLang b/share/html/Elements/SelectLang
index df98a13..65f0c7b 100644
--- a/share/html/Elements/SelectLang
+++ b/share/html/Elements/SelectLang
@@ -59,11 +59,9 @@
 </select>
 <%ARGS>
 $ShowNullOption => 1
-$ShowAllQueues => 1
 $Name => undef
 $Verbose => undef
 $Default => 0
-$Lite => 0
 </%ARGS>
 
 <%ONCE>

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


More information about the Rt-commit mailing list