diff options
author | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
commit | b8cfd0780aa40bb07f3215bf9cb58011f5e32a35 (patch) | |
tree | 5b5deb6f64cf6eb9f4630675725b59e7bfad137a /rt/lib/RT/Templates_Overlay.pm | |
parent | 0a2e57727e8f00fdc8ec4596619fb206c95fa919 (diff) | |
parent | c582e92888b4a5553e1b4e5214cf35217e4a0cf0 (diff) |
This commit was generated by cvs2svn to compensate for changes in r3874,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/Templates_Overlay.pm')
-rw-r--r-- | rt/lib/RT/Templates_Overlay.pm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/rt/lib/RT/Templates_Overlay.pm b/rt/lib/RT/Templates_Overlay.pm index 6bc992e05..544096233 100644 --- a/rt/lib/RT/Templates_Overlay.pm +++ b/rt/lib/RT/Templates_Overlay.pm @@ -137,5 +137,40 @@ sub NewItem { } # }}} +# {{{ sub Next + +=head2 Next + +Returns the next template that this user can see. + +=cut + +sub Next { + my $self = shift; + + + my $templ = $self->SUPER::Next(); + if ((defined($templ)) and (ref($templ))) { + + # If it's part of a queue, and the user can read templates in + # that queue, or the user can globally read templates, show it + if ($templ->Queue && $templ->CurrentUserHasQueueRight('ShowTemplate') or + $templ->CurrentUser->HasRight(Object => $RT::System, Right => 'ShowTemplate')) { + return($templ); + } + + #If the user doesn't have the right to show this template + else { + return($self->Next()); + } + } + #if there never was any template + else { + return(undef); + } + +} +# }}} + 1; |