AUTHENTICATED_USER.name vs .getUserName() (was RE: hiding site co ntent based upon a domain?) ntent based upon a domain?)
6 Aug
1999
6 Aug
'99
3:53 p.m.
No. The problem is that:
<!--#if "AUTHENTICATED_USER=='AnonUser'"-->
Should be:
<!--#if "AUTHENTICATED_USER.name=='AnonUser'"-->
Because AUTHENTICATED_USER is a user *object*, not a string. The string representation of a user object is its .name attribute, but if you try to just compare a user object to a string, it will always fail.
The more preferred way is to use AUTHENTICATED_USER.getUserName(), since more complex User Folders (UserDb's, LDAP User Folders, etc) might construct the user from different attributes. There are some basic methods defined on the BasicUser object (from which most AUTH_USER's are derived) for getting the user name, roles, roles in context, etc.
9740
Age (days ago)
9740
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jeffrey Shell