Skip to content

Commit 3878444

Browse files
author
Alexander Smishlajev
committed
add permission filter to menu() implementations [SF#1431188]
1 parent 3e10c18 commit 3878444

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Fixed:
88
(sf bug 1429669)
99
- error in link property lookups with numeric-alike key values (sf bug 1424550)
1010
- ignore UTF-8 BOM in .po files
11+
- add permission filter to menu() implementations (sf bug 1431188)
1112

1213

1314
2006-02-10 1.1.0

roundup/cgi/templating.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,10 @@ def menu(self, size=None, height=None, showid=0, additional=[], value=None,
17571757
else:
17581758
sort_on = ('+', find_sort_key(linkcl))
17591759

1760-
options = linkcl.filter(None, conditions, sort_on, (None, None))
1760+
options = [opt
1761+
for opt in linkcl.filter(None, conditions, sort_on, (None, None))
1762+
if self._db.security.hasPermission("View", self._client.userid,
1763+
linkcl.classname, itemid=id)]
17611764

17621765
# make sure we list the current value if it's retired
17631766
if value and value not in options:
@@ -1940,7 +1943,10 @@ def menu(self, size=None, height=None, showid=0, additional=[],
19401943
else:
19411944
sort_on = ('+', find_sort_key(linkcl))
19421945

1943-
options = linkcl.filter(None, conditions, sort_on)
1946+
options = [opt
1947+
for opt in linkcl.filter(None, conditions, sort_on)
1948+
if self._db.security.hasPermission("View", self._client.userid,
1949+
linkcl.classname, itemid=id)]
19441950
height = height or min(len(options), 7)
19451951
l = ['<select multiple name="%s" size="%s">'%(self._formname, height)]
19461952
k = linkcl.labelprop(1)

0 commit comments

Comments
 (0)