improve security audit views

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@4074 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-11-13 16:46:30 +00:00
parent a3a44a42d8
commit 2d6b34f8a7
2 changed files with 9 additions and 4 deletions

View file

@ -39,8 +39,11 @@
tal:repeat="role item/roles" tal:repeat="role item/roles"
tal:content="role" /> tal:content="role" />
</tr> </tr>
<tr tal:repeat="obj item/objects"> <tr tal:repeat="obj item/objects"
<td tal:content="obj/title" /> tal:attributes="class python: repeat['obj'].odd() and 'even' or 'odd';">
<td>
<a tal:attributes="href python:view.getUrlForTarget(obj['object'])"
tal:content="obj/title" /></td>
<td class="center" <td class="center"
tal:repeat="setting obj/settings" tal:repeat="setting obj/settings"
tal:content="setting" /> tal:content="setting" />
@ -59,7 +62,8 @@
<a tal:attributes="href python:view.getUrlForTarget(ws)" <a tal:attributes="href python:view.getUrlForTarget(ws)"
tal:content="ws/title" /></th> tal:content="ws/title" /></th>
</tr> </tr>
<tr tal:repeat="person item/persons"> <tr tal:repeat="person item/persons"
tal:attributes="class python: repeat['person'].odd() and 'even' or 'odd';">
<td> <td>
<a tal:attributes="href python:view.getUrlForTarget(person)" <a tal:attributes="href python:view.getUrlForTarget(person)"
tal:content="person/title" /></td> tal:content="person/title" /></td>

View file

@ -66,7 +66,8 @@ class RolePermissionsByType(BaseSecurityView):
if not self.selectedType: if not self.selectedType:
return [] return []
result = self.selectedType['object'].getChildren([self.typePredicate]) result = self.selectedType['object'].getChildren([self.typePredicate])
return [dict(title=o.title, settings=self.getPermissionSettings(o)) return [dict(title=o.title, object=o,
settings=self.getPermissionSettings(o),)
for o in result] for o in result]
def getPermissionSettings(self, obj): def getPermissionSettings(self, obj):