[Rt-commit] rt branch, showglobaltemplates, updated. rt-3.8.8-184-ge469eb1

Chia-liang Kao clkao at bestpractical.com
Thu Jul 29 07:40:18 EDT 2010


The branch, showglobaltemplates has been updated
       via  e469eb1419f1e440669206c1a26ae692cba6c489 (commit)
      from  605565b99070caa311c418011e673c296e856d53 (commit)

Summary of changes:
 lib/RT/Template_Overlay.pm |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit e469eb1419f1e440669206c1a26ae692cba6c489
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Thu Jul 29 17:28:28 2010 +0800

    Make ShowGlobalTemplates a more limited right

diff --git a/lib/RT/Template_Overlay.pm b/lib/RT/Template_Overlay.pm
index 9ce0549..e6f2f17 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -476,9 +476,13 @@ sub CurrentUserHasQueueRight {
 
 sub CurrentUserCanRead {
     my $self =shift;
-    return $self->QueueObj->Id
-        ? $self->CurrentUserHasQueueRight('ShowTemplate')
-        : $self->CurrentUser->HasRight( Right =>'ShowGlobalTemplates', Object => $RT::System );
+
+    return 1 if $self->CurrentUserHasQueueRight('ShowTemplate');
+
+    return $self->CurrentUser->HasRight( Right =>'ShowGlobalTemplates', Object => $RT::System )
+        if !$self->QueueObj->Id;
+
+    return;
 }
 
 

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


More information about the Rt-commit mailing list