Move node access checks to load instead of display

rush86999 - May 4, 2008 - 20:51
Project:Activity
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:critical
Assigned:Unassigned
Status:active
Description

Also I have not tried this but to mention does activity respect User Relationship Node access module? Otherwords when a user selects which relationship can view the node will activity also not record it if the other user's relationship is not selected to view the node?

#1

Scott Reynolds - August 6, 2008 - 06:34
Title:UR node access» Doesn't Respect Node Access

I have two patches for nodeactivity and commentactivity that call node_access('view', $nid) in hook_activityapi(). This isn't ideal, be great if activity table had a primary_id field. THEN that could be used.

Maybe that wouldn't make it simpler.. not sure. Something to consider. But this works!

AttachmentSize
nodeactivity.patch 496 bytes
commentactivity.patch 952 bytes

#2

txcrew - September 20, 2008 - 16:55
Status:active» needs work

This needs to be a feature in the module.

I'm getting this error after patching the commentactivity contrib.

    * warning: Invalid argument supplied for foreach() in /home/mysite/public_html/modules/node/node.module on line 561.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/mysite/public_html/modules/node/node.module on line 565.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/mysite/public_html/includes/database.mysql.inc on line 172.

What could be causing this?

#3

txcrew - September 20, 2008 - 16:58

The Node Activity Patch seems to be working for the most part. However, it does still output an empty <li> see attached screenshot.

AttachmentSize
Empty LI 6.85 KB

#4

jaydub - October 18, 2008 - 05:58

#5

minesota - October 18, 2008 - 06:02

Subscribed

#6

geodaniel - October 18, 2008 - 10:42

subscribing

#7

lelizondob - October 19, 2008 - 18:20

subscribing

#8

jaydub - October 31, 2008 - 08:49

Ok I think the approach the original poster took in their patch is sound. I am adding this now but it will need testing across the various activity contrib modules.

#9

jaydub - October 31, 2008 - 09:28

Added an access check to the display phase of the activity records. Please test out on a development snapshot (10/31 or later).

#10

jaydub - November 4, 2008 - 12:02
Category:support request» task

#11

jaydub - February 20, 2009 - 06:45
Title:Doesn't Respect Node Access» Move node access checks to load instead of display
Version:5.x-3.0-beta2» 6.x-1.x-dev
Status:needs work» active

I've changed the title to reflect the current state of this task. We need to change the model for node access to act on activity load and not on display. This will require activity records to be able to store content IDs so that access checks can be made at load time.

This is likely to be a 6.2 branch feature.

#12

mErilainen - November 13, 2009 - 13:46
Priority:normal» critical

I would say that this is very critical. Currently I can see all the topics of comments listed in activity from private groups for example.

I'm not familiar with views filters, but I managed to hide comments which the user didn't have access with "Node access"-filter in another view. Would it be possible to have this filter in Activity also, so that the view wouldn't list the activity if the user doesn't have access to the node? Then there should be some other way to hide them from activity/all-listing.

 
 

Drupal is a registered trademark of Dries Buytaert.