debug-menu permission, closes #1068

Also added tests for navigation menu logic.
This commit is contained in:
Simon Willison 2020-10-30 08:41:57 -07:00
commit 222f79bb4c
6 changed files with 58 additions and 4 deletions

View file

@ -96,7 +96,8 @@ class PermissionsDebugView(BaseView):
return await self.render(
["permissions_debug.html"],
request,
{"permission_checks": reversed(self.ds._permission_checks)},
# list() avoids error if check is performed during template render:
{"permission_checks": list(reversed(self.ds._permission_checks))},
)