Code

- changed template to remove duplicate display table, using built-in
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 19 Jan 2004 23:57:47 +0000 (23:57 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 19 Jan 2004 23:57:47 +0000 (23:57 +0000)
  permission checks now
- fixed permissions settings for anonymous to make view work again for them

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2046 57a73879-2fb5-44c3-a270-3262357dd7e2

templates/classic/dbinit.py
templates/classic/html/issue.item.html

index 8905e3cac7667971fd20a53f26b7b36b53984c63..83e938686fb5045d1524e71e2a64b69e17088792 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: dbinit.py,v 1.2 2003-11-10 03:56:39 richard Exp $
+# $Id: dbinit.py,v 1.3 2004-01-19 23:57:47 richard Exp $
 
 import os
 
@@ -132,11 +132,11 @@ def open(name=None):
     # - Allow anonymous (new) users to register through the email gateway
     p = db.security.getPermission('Email Registration')
     db.security.addPermissionToRole('Anonymous', p)
-    # - Allow anonymous users access to the "issue" class of data
-    #   Note: this also grants access to related information like files,
-    #         messages, statuses etc that are linked to issues
-    p = db.security.getPermission('View', 'issue')
-    db.security.addPermissionToRole('Anonymous', p)
+    # - Allow anonymous users access to view issues (which implies being
+    #   able to view all linked information too
+    for cl in 'issue', 'file', 'msg', 'keyword':
+        p = db.security.getPermission('View', cl)
+        db.security.addPermissionToRole('Anonymous', p)
     # - Allow anonymous users access to edit the "issue" class of data
     #   Note: this also grants access to create related information like
     #         files and messages etc that are linked to issues
@@ -202,3 +202,4 @@ def init(adminpw):
 
 # vim: set filetype=python ts=4 sw=4 et si
 
+#SHA: 92c54c05ba9f59453dc74fa9fdbbae34f7a9c077
index 2c516b4c585230d66d0d7157bd538a5d533ad7ed..28e12625cb18f32e3322ebde966c071fcf676e66 100644 (file)
@@ -4,22 +4,17 @@
 <span tal:replace="config/TRACKER_NAME" />: 
 <span tal:condition="context/id"
        tal:replace="string:Issue ${context/id}: ${context/title}" />
-<tal:x tal:condition="not:context/id">New Issue</tal:x> 
 </title> 
 <span metal:fill-slot="body_title" tal:omit-tag="python:1">
+ <tal:x tal:condition="not:context/id">New</tal:x> 
   Issue<span tal:replace="context/id" />
    <tal:x tal:condition="context/is_edit_ok">Editing</tal:x>
  </span>
 
 <td class="content" metal:fill-slot="content">
 
-<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
-You are not allowed to view this page.
-</span>
-
 <form method="POST" name="itemSynopsis" onSubmit="return submit_once()"
-      enctype="multipart/form-data" tal:condition="context/is_edit_ok"
-      tal:attributes="action context/designator">
+      enctype="multipart/form-data" tal:attributes="action context/designator">
 
 <table class="form">
 <tr>
@@ -62,7 +57,7 @@ python:db.user.classhelp('username,realname,address', property='nosy', width='60
  </td>
 </tr>
 
-<tr>
+<tr tal:condition="context/is_edit_ok">
  <th>Change Note</th>
  <td colspan=3>
   <textarea tal:content="request/form/@note/value | default"
@@ -70,12 +65,12 @@ python:db.user.classhelp('username,realname,address', property='nosy', width='60
  </td>
 </tr>
 
-<tr>
+<tr tal:condition="context/is_edit_ok">
  <th>File</th>
  <td colspan=3><input type="file" name="@file" size="40"></td>
 </tr>
 
-<tr>
+<tr tal:condition="context/is_edit_ok">
  <td>
   &nbsp;
   <input type="hidden" name="@template" value="item">
@@ -85,7 +80,9 @@ python:db.user.classhelp('username,realname,address', property='nosy', width='60
   submit button will go here
  </td>
 </tr>
+
 </table>
+
 </form>
 
 <table class="form" tal:condition="not:context/id">
@@ -96,79 +93,48 @@ python:db.user.classhelp('username,realname,address', property='nosy', width='60
 </tr>
 </table>
 
-<table class="form" tal:condition="context/is_only_view_ok">
-<tr>
- <th>Title</th><td colspan=3 tal:content="context/title">title</td>
-</tr>
-
-<tr>
- <th>Priority</th><td tal:content="context/priority">priority</td>
- <th>Status</th><td tal:content="context/status">status</td>
-</tr>
-
-<tr>
- <th>Superseder</th>
- <td>
-  <span tal:condition="context/superseder" tal:repeat="sup context/superseder">
-   <br>View: <a tal:attributes="href string:issue${sup/id}"
-                tal:content="sup/id"></a>
-  </span>
- </td>
- <th>Nosy List</th><td><span tal:replace="context/nosy" /></td>
-</tr>
-
-<tr>
- <th>Assigned To</th><td tal:content="context/assignedto"></td>
- <th>Topics</th><td tal:content="structure context/topic"></td>
-</tr>
-</table>
-
-<tal:block tal:condition="python:context.id and context.is_view_ok()">
-
- <p tal:content="structure string:Created on
+<p tal:condition="context/id" tal:content="structure string:Created on
   <b>${context/creation}</b> by <b>${context/creator}</b>, last
   changed <b>${context/activity}</b>.">activity info
- </p>
-
- <table class="messages" tal:condition="context/messages">
-  <tr><th colspan="4" class="header">Messages</th></tr>
-  <tal:block tal:repeat="msg context/messages/reverse">
-   <tr>
-    <th><a tal:attributes="href string:msg${msg/id}"
-           tal:content="string:msg${msg/id}"></a></th>
-    <th tal:content="string:Author: ${msg/author}">author</th>
-    <th tal:content="string:Date: ${msg/date}">date</th>
-    <th>
-     <a tal:condition="context/is_edit_ok"
-        tal:attributes="href string:issue${context/id}?@remove@messages=${msg/id}&@action=edit">remove</a>
-    </th>
-   </tr>
-   <tr>
-    <td colspan="4" class="content">
-     <pre tal:content="structure msg/content/hyperlinked">content</pre>
-    </td>
-   </tr>
-  </tal:block>
- </table>
-
- <table class="files" tal:condition="context/files">
-  <tr><th colspan="2" class="header">Files</th></tr>
-  <tr><th>File name</th><th>Uploaded</th></tr>
-  <tr tal:repeat="file context/files">
-   <td>
-    <a tal:attributes="href string:file${file/id}/${file/name}"
-       tal:content="file/name">dld link</a>
-   </td>
-   <td>
-    <span tal:content="file/creator">creator's name</span>,
-    <span tal:content="file/creation">creation date</span>
+</p>
+
+<table class="messages" tal:condition="context/messages">
+ <tr><th colspan="4" class="header">Messages</th></tr>
+ <tal:block tal:repeat="msg context/messages/reverse">
+  <tr>
+   <th><a tal:attributes="href string:msg${msg/id}"
+          tal:content="string:msg${msg/id}"></a></th>
+   <th tal:content="string:Author: ${msg/author}">author</th>
+   <th tal:content="string:Date: ${msg/date}">date</th>
+   <th>
+    <a tal:condition="context/is_edit_ok"
+       tal:attributes="href string:issue${context/id}?@remove@messages=${msg/id}&@action=edit">remove</a>
+   </th>
+  </tr>
+  <tr>
+   <td colspan="4" class="content">
+    <pre tal:content="structure msg/content/hyperlinked">content</pre>
    </td>
   </tr>
- </table>
+ </tal:block>
+</table>
 
- <tal:block tal:replace="structure context/history" />
+<table class="files" tal:condition="context/files">
+ <tr><th colspan="2" class="header">Files</th></tr>
+ <tr><th>File name</th><th>Uploaded</th></tr>
+ <tr tal:repeat="file context/files">
+  <td>
+   <a tal:attributes="href string:file${file/id}/${file/name}"
+      tal:content="file/name">dld link</a>
+  </td>
+  <td>
+   <span tal:content="file/creator">creator's name</span>,
+   <span tal:content="file/creation">creation date</span>
+  </td>
+ </tr>
+</table>
 
-</tal:block>
+<tal:block tal:condition="context/id" tal:replace="structure context/history" />
 
 </td>