[Zope] Zope Newbie needs help with DTML

sean.upton@uniontrib.com sean.upton@uniontrib.com
Tue, 18 Dec 2001 09:51:04 -0800


You cannot embed DTML inside a DTML expression, rather, just refer to the
varaible name as X, assuming it contains the right type of data to match
getRoles().  Sean

-----Original Message-----
From: Mike Doanh Tran [mailto:mtran@shufflemasterrd.com]
Sent: Tuesday, December 18, 2001 9:24 AM
To: zope@zope.org
Cc: lazug@lazug.org
Subject: [Zope] Zope Newbie needs help with DTML


Hi all,

I couldn't get this code to work in Zope.  Can some one help me please?

#####################################################
<dtml-if "AUTHENTICATED_USER.getRoles() =='<dtml-var X>'">
Then execute code
<dtml-else> Permission Denied!
</dtml-if>
#####################################################

The .getRoles() method returns a string of more than one roles 
('Manager','Owner','*******').  Assume that <dtml-var X> = Owner ,how do i 
chop off the return of getRoles() to validate the above statement?

thanks,

-- 
Mike Tran
Shuffle Master Gaming Inc.

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )