Fixed an issue where some access checks would fail due to missing arguments.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 04 Jun 2009 22:01:57 +0200
changeset 2386 a518ea56f6b5
parent 2384 71780864a5ed
child 2388 eb1a6abdb056
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.
app/soc/views/models/document.py
--- 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'})