Fixed an issue where some access checks would fail due to missing arguments.
This happens when an org document is being checked for write access when trying to show the edit link on the document's show page.
--- a/app/soc/views/models/document.py Thu Jun 04 21:58:05 2009 +0200
+++ b/app/soc/views/models/document.py Thu Jun 04 22:01:57 2009 +0200
@@ -135,13 +135,17 @@
allowed_to_edit = False
try:
# use the IsDocumentWritable check because we have no django args
- rights.checkIsDocumentWritable({'key_name': entity.key().name()},
+ rights.checkIsDocumentWritable({'key_name': entity.key().name(),
+ 'prefix': entity.prefix,
+ 'scope_path': entity.scope_path,
+ 'link_id': entity.link_id},
'key_name')
allowed_to_edit = True
except:
pass
if allowed_to_edit:
+ # add the document edit redirect to the context
context['edit_redirect'] = redirects.getEditRedirect(
entity, {'url_name': 'document'})