Skip to content

Commit 3897f6a

Browse files
author
Richard Jones
committed
some bits I missed, and the next release will be beta ;)
1 parent 347a811 commit 3897f6a

File tree

6 files changed

+35
-37
lines changed

6 files changed

+35
-37
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4-
2005-01-?? 0.8.0
4+
2005-01-?? 0.8.0b3
55
Fixed:
66
- fix roundup-server log and PID file paths to be absolute
77
- fix initialisation of roundup-server in daemon mode so initialisation

templates/classic/html/_generic.item.html

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
<td class="content" metal:fill-slot="content">
1111

12-
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"
13-
tal:omit-tag="python:1" i18n:translate=""
14-
>You are not allowed to view this page.</span>
12+
<p tal:condition="not:context/is_view_ok" i18n:translate="">You are not
13+
allowed to view this page.</p>
14+
15+
<div tal:condition="context/is_view_ok">
1516

1617
<form method="POST" onSubmit="return submit_once()"
17-
enctype="multipart/form-data" tal:condition="context/is_edit_ok"
18+
enctype="multipart/form-data" tal:condition="context/is_view_ok"
1819
tal:attributes="action context/designator">
1920

2021
<input type="hidden" name="@template" value="item">
@@ -38,21 +39,9 @@
3839

3940
</form>
4041

41-
<table class="form" tal:condition="context/is_only_view_ok">
42-
43-
<tr tal:repeat="prop python:db[context._classname].properties()">
44-
<tal:block tal:condition="python:prop._name not in ('id', 'creator',
45-
'creation', 'activity')">
46-
<th tal:content="prop/_name"></th>
47-
<td tal:content="structure python:context[prop._name].field()"></td>
48-
</tal:block>
49-
</tr>
50-
</table>
51-
42+
<tal:block tal:condition="context/id" tal:replace="structure context/history" />
5243

53-
<tal:block tal:condition="python:context.id and context.is_view_ok()">
54-
<tal:block tal:replace="structure context/history" />
55-
</tal:block>
44+
</div>
5645

5746
</td>
5847

templates/classic/html/file.item.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
<td class="content" metal:fill-slot="content">
88

9-
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"
10-
tal:omit-tag="python:1" i18n:translate=""
11-
>You are not allowed to view this page.</span>
9+
<p tal:condition="not:context/is_view_ok" i18n:translate="">You are not
10+
allowed to view this page.</p>
1211

1312
<form method="POST" onSubmit="return submit_once()"
14-
enctype="multipart/form-data" tal:condition="context/is_edit_ok"
13+
enctype="multipart/form-data" tal:condition="context/is_view_ok"
1514
tal:attributes="action context/designator">
1615

1716
<table class="form">
@@ -42,19 +41,8 @@
4241
tal:attributes="href string:file${context/id}/${context/name}"
4342
i18n:translate="">download</a>
4443

45-
<table class="form" tal:condition="context/is_only_view_ok">
46-
<tr>
47-
<th i18n:translate="">Name</th>
48-
<td tal:content="context/name"></td>
49-
</tr>
50-
<tr>
51-
<th i18n:translate="">Content Type</th>
52-
<td tal:content="context/type"></td>
53-
</tr>
54-
</table>
44+
<tal:block tal:condition="context/id" tal:replace="structure context/history" />
5545

56-
<tal:block tal:condition="python:context.id and context.is_view_ok()"
57-
tal:replace="structure context/history" />
5846
</td>
5947

6048
</tal:block>

templates/classic/html/msg.item.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
replace="context/id" i18n:name="id" /> Editing</span>
2323
</tal:block>
2424
<td class="content" metal:fill-slot="content">
25+
26+
<p tal:condition="not:context/is_view_ok" i18n:translate="">You are not
27+
allowed to view this page.</p>
28+
29+
<div tal:condition="context/is_view_ok">
2530
<table class="form">
2631

2732
<tr>
@@ -66,6 +71,8 @@
6671
</table>
6772

6873
<tal:block tal:replace="structure context/history" />
74+
75+
</div>
6976
</td>
7077

7178
</tal:block>

templates/classic/html/user.item.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525

2626
<td class="content" metal:fill-slot="content">
2727

28+
<p tal:condition="not:context/is_view_ok" i18n:translate="">You are not
29+
allowed to view this page.</p>
30+
31+
<div tal:condition="context/is_view_ok">
32+
2833
<form method="POST" onSubmit="return submit_once()"
2934
enctype="multipart/form-data"
3035
tal:attributes="action context/designator">
@@ -94,7 +99,9 @@
9499
</table>
95100
</form>
96101

97-
<tal:block tal:replace="structure context/history" />
102+
<tal:block tal:condition="context/id" tal:replace="structure context/history" />
103+
104+
</div>
98105

99106
</td>
100107

test/test_security.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
# $Id: test_security.py,v 1.8 2005-01-28 03:51:19 richard Exp $
21+
# $Id: test_security.py,v 1.9 2005-01-28 04:07:58 richard Exp $
2222

2323
import os, unittest, shutil
2424

@@ -124,6 +124,13 @@ def testAccessControls(self):
124124
# *any* access to class
125125
self.assertEquals(has('Test', user1, 'test'), 1)
126126
self.assertEquals(has('Test', user2, 'test'), 1)
127+
128+
# *any* access to item
129+
self.assertEquals(has('Test', user1, 'test', itemid='1'), 1)
130+
self.assertEquals(has('Test', user2, 'test', itemid='1'), 1)
131+
self.assertEquals(has('Test', super, 'test', itemid='1'), 1)
132+
self.assertEquals(has('Test', none, 'test', itemid='1'), 0)
133+
127134
# now property test
128135
self.assertEquals(has('Test', user2, 'test', property='a'), 1)
129136
self.assertEquals(has('Test', user2, 'test', property='b'), 1)

0 commit comments

Comments
 (0)