Skip to content

Commit b0eda4a

Browse files
author
Richard Jones
committed
make user permissions check more sane (fix search page for anonymous)
1 parent a6d0212 commit b0eda4a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Fixed:
2525
- handle postgresql bug in SQL generation (sf bug 984591)
2626
- fix dates-from-Dates (sf bug 984604)
2727
- fix messageid generated when msgid is None for send_message (sf bug 987933)
28+
- make user permissions check more sane (fix search page for anonymous)
2829

2930

3031
2004-06-24 0.7.5

roundup/cgi/templating.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ def _user_perm_check(self, type):
10331033
# may anonymous users register? (so, they need to be anonymous,
10341034
# need the Web Rego permission, and not trying to view an item)
10351035
rego = s.hasPermission('Web Registration', userid, self._classname)
1036+
rego = rego and self._client.template == 'register'
10361037
if is_anonymous and rego and getattr(self, '_nodeid', None) is None:
10371038
return 1
10381039

templates/classic/html/issue.search.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171

7272
<tr tal:define="name string:creator;
7373
db_klass string:user;
74-
db_content string:username;">
74+
db_content string:username;"
75+
tal:condition="db/user/is_view_ok">
7576
<th i18n:translate="">Creator:</th>
7677
<td metal:use-macro="search_select">
7778
<option metal:fill-slot="extra_options" i18n:translate=""
@@ -90,7 +91,10 @@
9091
<td>&nbsp;</td>
9192
</tr>
9293

93-
<tr tal:define="name string:actor">
94+
<tr tal:define="name string:actor;
95+
db_klass string:user;
96+
db_content string:username;"
97+
tal:condition="db/user/is_view_ok">
9498
<th i18n:translate="">Actor:</th>
9599
<td metal:use-macro="search_select">
96100
<option metal:fill-slot="extra_options" i18n:translate=""
@@ -133,7 +137,8 @@
133137

134138
<tr tal:define="name string:assignedto;
135139
db_klass string:user;
136-
db_content string:username;">
140+
db_content string:username;"
141+
tal:condition="db/user/is_view_ok">
137142
<th i18n:translate="">Assigned to:</th>
138143
<td metal:use-macro="search_select">
139144
<tal:block metal:fill-slot="extra_options">

0 commit comments

Comments
 (0)