Assignment of role rights to both content nodes
Author: Dr. Frank Hoffmann, 2005/06/12
Redirecting of an authenticated user (in the role Subscriber [ZMSSubscriber]) requires two nodes due to the primarily hierarchicallly organised rights inheritance. The nodes must be assigned to subscribers: 1. general Login page with Redirect, 2. personal content node
1. PRIMARYE AUTENTICATION: A content node for the initial Login (for all the same); here the method pageelement_IndexAuthUser.dtml is inserted in a text section or invoked through it from the template level. The method generates a Redirect.
2. PERSONAL FOLDER: individual content folder in the data node; here the personal data are lying which other users cannot look at.
The method pageelement_IndexAuthUser.dtml reads the username out of the primary authentication and redirects the request to the first individual folder. Alternatively with the same method a list of the personal folders can be displayed as link list that the logged-in user then may select explicitely.
<!-- pageelement_IndexAuthUser -->
<dtml-comment>
<!-- table of contents based upon users authentification -->
<!-- redirecting to the first PAGE Object -->
<!-- Author: Dr. F Hoffmann -->
<!-- Date: Jun 09 2005 -->
<!-- 1. iterate all nodes of the user that he has been invited to -->
<!-- 2. check wether the current id is in one of the corresponding -->
<!-- node paths in the correct language -->
</dtml-comment>
<!-- please define your entry node -->
<dtml-in "content.e164.e166.filteredChildNodes(REQUEST,PAGES)">
<dtml-if sequence-start>
<h2>Access for user: <i><dtml-var AUTHENTICATED_USER></i></h2>
</dtml-if>
<ul>
<dtml-let nodes="getUserAttr(AUTHENTICATED_USER,'nodes',{})"
nodekeys="nodes.keys()">
<dtml-in nodekeys>
<dtml-let seqindex=sequence-index nodekey=sequence-item
nodevalue="nodes[nodekey]"
ob="getLinkObj(nodekey,REQUEST)">
<dtml-if ob>
<dtml-call "REQUEST.set('ob_path_id_list',[])">
<dtml-in "ob.breadcrumbs_obj_path()">
<dtml-call "ob_path_id_list.append('%s'%getId())">
</dtml-in>
<dtml-if "this().getId() in ob_path_id_list and
lang in nodevalue.get('langs',[])">
<dtml-unless "REQUEST['URL'].find('manage')>0">
<!-- redirects to the first item -->
<dtml-call "RESPONSE.redirect(getHref2IndexHtml(REQUEST,deep=0))">
<!-- /redirects to the first item -->
</dtml-unless>
<li>
<a href="<dtml-var "getHref2IndexHtml(REQUEST,deep=0)">">
<dtml-var "getTitle(REQUEST)"></a>
<dtml-if "getObjProperty('attr_dc_description',REQUEST)">
<br /><dtml-var "getObjProperty('attr_dc_description',REQUEST)">
</dtml-if>
</li>
</dtml-if>
</dtml-if>
</dtml-let>
</dtml-in>
</dtml-let>
</ul>
</dtml-in>
<!-- /pageelement_IndexAuthUser -->