Error using session{'CurrentUser'} on custom header

Hello,

I have a custom “Header” in my /local/html/Elements folder. I am trying
to add a link to the nav links at the top right of the page. The
pertinent code (with my additions marked) is below. This will create
the link I’m after, but it breaks the Logout and Preferences links.
Using them generates an error page with the message “Can’t call method
"HasRight” on an undefined value at
/opt/rt3/bin/…/lib/RT/User_Overlay.pm line 1250."

I’m trying to provide my own help link to users, but will want different
pages available to different users, based on their rights (eventually I
would have a more elaborate if->elseif->…else construction than what
appears below; otherwise, I would just tack what I’m doing into the
earlier $session{‘CurrentUser’} block). I had thought to test the
user’s rights to do this, but it would seem my handling of
$session{‘CurrentUser’} is erroneous.

Any help is appreciated.

Thanks,
Chad

% if ($ShowBar) {
<& /Elements/Logo, %ARGS &>

<&|/l&>Skip Menu | % if ($session{'CurrentUser'}->Name) { <&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] % if ( $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System ) ) { | <&|/l&>Preferences % } % } else { <&|/l&>Not logged in. % }

% $m->callback( %ARGS );
<& Logout, %ARGS &>

%# I ADDED THIS
% if ( $session{‘CurrentUser’}->HasRight( Right => ‘ModifySelf’, Object
=> $RT::System ) ) {
| HELP
% }
%# END OF ADDITION

% }

Chad Sylvain/Itasca Consulting Group, Inc.
Communications, Marketing/612 371-4711