[Zope] Newbie question - Link between Methods based on Authorization

Timothy Wilson wilson@visi.com
Tue, 19 Dec 2000 11:26:14 -0600 (CST)


On Tue, 19 Dec 2000, Michal Krejza wrote:

> I have problem with access to method. Example - There are two methods: A and
> B. Method A contains common information, accessible for all user (include
> anonymous). Source code in method B updates data for method A and access for
> method B is restrict only for users with roles "AdminTables". There is a
> link from method A to method B in the code of script A, and this link is
> viewable for all user (also for anonym). After click on this link, user is
> asked for authentication. So there is no problem, but HOW MAKE THIS LINK
> VIEWABLE ONLY FOR USER WITH AUTORIZATION FOR OBJEKT B ???

Hello Michal,

This may work:

<dtml-if "AUTHENTICATED_USER.has_role('AdminTables', this())">
 <a href="/link/to/method/B">Method B</a>
</dtml-if>

-Tim

--
Tim Wilson      | Visit Sibley online:         | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |                              | http://slashdot.org/
wilson@visi.com |   <dtml-var pithy_quote>     | http://linux.com/