Problem: Unauthorized Locking of Nodes that cannot be edited

thekevinday - April 3, 2009 - 15:30
Project:Checkout (Content locking)
Version:6.x-2.2
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Take a user without permissions to view or edit some content type.

Lets say that content type nid is 45.

The said user go to the url and trigger a lock on content they are not allowed to edit or even view: http://example/node/45/edit

I can login as a user who _is_ authorized to edit and if the above user did what was mentioned, the "this document was locked by.." does in fact show up!

Additional Potentially Relevant Modules Installed: ACL, Content Access.

#1

thekevinday - May 8, 2009 - 17:53

#2

smk-ka - May 8, 2009 - 22:40
Status:active» needs review

Nice catch! I've just fixed on place: node_access() requires a node object, not a nid. Otherwise this looks good to me.

AttachmentSize
checkout.module-check_access.patch 1.19 KB

#3

thekevinday - May 11, 2009 - 14:00

Thanks for the correction, i rushed the patch out without much testing at all...

Something still went wrong during my testing, I looked at http://api.drupal.org/api/function/node_access/6

Apparently, it should not be 'edit' but instead be 'update'.

AttachmentSize
checkout.module-check_access.patch 1.2 KB

#4

smk-ka - June 17, 2009 - 17:23

Found a better solution using menu_get_item(): the hardwired node_access('update', ...) only checks for node edit permissions, which might be sufficient for node/%/edit, but not any other path that can be locked. For example, on node/%/outline we need to check for book.module's "administer outline" permission. This can be done by directly querying the menu system and letting it figure out the access permissions.

AttachmentSize
422870-checkout-access.patch 1.34 KB

#5

DanielTheViking - September 1, 2009 - 09:09

Subscribing.

#6

thekevinday - September 11, 2009 - 18:43

I have had the #4 patch applied for a little while now without any related troubles popup.

#7

cels - November 25, 2009 - 16:50

Has anyone tested if there are problems with
· Taxonomy Access Control
· Domain Access
· Domain Access pach: multiple_node_access patch (allows you to use AND logic instead of OR logic: ALL of the access' modules must allow you to view/edit the node, not only one)

I try to reproduce the scenary and test it.

 
 

Drupal is a registered trademark of Dries Buytaert.