1. python_mirrors
  2. tracker/setuptools

Commits

martin.v.loewis  committed e3bcaac Draft

Merge from python-dev:
Suppress display of user history to anybody but the user.

  • Participants
  • Parent commits 64a24be
  • Branches default

Comments (0)

Files changed (2)

File extensions/suppress_history.py

View file
+def is_history_ok(request):
+    user = request.client.userid
+    db = request.client.db
+    classname = request.classname
+    nodeid = request.nodeid
+    # restrict display of user history to user itself only
+    if classname == 'user':
+        return user == nodeid
+    # currently not used
+    return True
+
+def init(instance):
+    instance.registerUtil('is_history_ok', is_history_ok)

File html/user.item.html

View file
 </table>
 </tal:block>
 
+<tal:if condition="python:utils.is_history_ok(request)">
 <tal:block tal:condition="context/id" tal:replace="structure context/history" />
+</tal:if>
 
 </div>