Hi, everyone:

In my page template, I would like to show one message if the request
is authenticated, and other if the user has not logged in.

Is there a simple test I can use in the template file like?

<span tal:condition="request/unauthenticated">Please Log In</span>
<span tal:condition="not request/unauthenticated">Hello Mr. XXX</span>

Similiar thing used to work with Zope2. But with Zope3, request only
has an attribute 'principal', which will return a
<zope.app.security.principalregistry.UnauthenticatedPrincipal object
at 0x969d6ec> object.

I have seen code doing verification in the view class like this:

if (not IUnauthenticatedPrincipal.providedBy(request.principal):

But surely there will be a much simpler way to do this?

Hong Yuan

Zope3-users mailing list

Reply via email to