[Mpuls-commits] r2537 - wasko/branches/2.0/jmdweb/templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 28 12:51:22 CEST 2010


Author: torsten
Date: 2010-04-28 12:51:21 +0200 (Wed, 28 Apr 2010)
New Revision: 2537

Modified:
   wasko/branches/2.0/jmdweb/templates/main.mako
Log:
* jmdweb/templates/main.mako: Check permission to view the jmdstruktur
	modul



Modified: wasko/branches/2.0/jmdweb/templates/main.mako
===================================================================
--- wasko/branches/2.0/jmdweb/templates/main.mako	2010-04-28 10:50:36 UTC (rev 2536)
+++ wasko/branches/2.0/jmdweb/templates/main.mako	2010-04-28 10:51:21 UTC (rev 2537)
@@ -143,23 +143,38 @@
         % endif
       </div>
     </div>
-    <div class="menu">
-      <div class="actions">
-        <h1>${_('Strukturdaten')}</h1>
-        <ul>
-          <li>
-            <a href="${h.url_for(controller='/jmdstruktur')}">
-              ${_('JMD-Fallakten')}
-            </a>
-          </li>
-          <li>
-            <a href="${h.url_for(controller='/jmdstruktur/new')}">
-              ${_('JMD-Fallakte anlegen')}
-            </a>
-          </li>
-        </ul>
+    <%
+    from mpulsweb.model.agencysettings import Agency
+    permission = [int(id) for id in Agency().get_value('jmdstrukur_permission_userid', []).split(',')]
+    %>
+    % if session['USER_AUTHORIZED'].id in permission or h.hasRole(['admin']):
+      <div class="menu">
+        <div class="actions">
+          <h1>${_('Strukturdaten')}</h1>
+          <ul>
+            % if session['USER_AUTHORIZED'].id in permission:
+              <li>
+                <a href="${h.url_for(controller='/jmdstruktur')}">
+                  ${_('JMD-Fallakten')}
+                </a>
+              </li>
+              <li>
+                <a href="${h.url_for(controller='/jmdstruktur/new')}">
+                  ${_('JMD-Fallakte anlegen')}
+                </a>
+              </li>
+            %endif
+            %if h.hasRole(['admin']):
+            <li>
+              <a href="${h.url_for(controller='/jmdstruktur/permission')}">
+                ${_('Benutzerberechtigungen')}
+              </a>
+            </li>
+            %endif
+          </ul>
+        </div>
       </div>
-    </div>
+    % endif
     % if g.mpuls_config.is_enabled('module', 'evaluation'):
       <div class="menu">
         <div class="actions">



More information about the Mpuls-commits mailing list