diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-12 15:19:00 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 17:56:38 -0700 |
commit | 2c09925cad2ade037e6ae953e4ed6fc056811f2f (patch) | |
tree | b83e342cc0e770e65a464facbf96be9586315aad /rt/lib/RT/Template.pm | |
parent | 45ac1a8f1af9c7d63d296497a305b82f07eccab6 (diff) |
rt 4.0.23
Diffstat (limited to 'rt/lib/RT/Template.pm')
-rwxr-xr-x | rt/lib/RT/Template.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm index a6c0f7d0b..ecf094620 100755 --- a/rt/lib/RT/Template.pm +++ b/rt/lib/RT/Template.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -740,10 +740,14 @@ sub CompileCheck { sub CurrentUserCanRead { my $self =shift; - return 1 if $self->CurrentUserHasQueueRight('ShowTemplate'); - - return $self->CurrentUser->HasRight( Right =>'ShowGlobalTemplates', Object => $RT::System ) - if !$self->QueueObj->Id; + if ($self->__Value('Queue')) { + my $queue = RT::Queue->new( RT->SystemUser ); + $queue->Load( $self->__Value('Queue')); + return 1 if $self->CurrentUser->HasRight( Right => 'ShowTemplate', Object => $queue ); + } else { + return 1 if $self->CurrentUser->HasRight( Right => 'ShowGlobalTemplates', Object => $RT::System ); + return 1 if $self->CurrentUser->HasRight( Right => 'ShowTemplate', Object => $RT::System ); + } return; } |