Problem/Motivation

(non-critical) Follow-up to #3165126: Access bypass: notification emails sent for nodes a user can't access -- Although that issue correctly prevents group_notify from sending notifications to users who can't access the content on the live site, there's an edge case I missed.

Steps to reproduce

  1. Install group, gnode, group_notify
  2. Create group type + group
  3. Configure to send notifications
  4. Create an admin user that can see unpublished content, subscribe it to the group
  5. Create a new unpublished node
  6. Watch the admin user get an email

Proposed resolution

In addition to the existing access check, also test the published status of the entity (node or comment) and bail from group_notify_notify().

Perhaps this should be a config option?

Remaining tasks

  1. Decide if this behavior should have a setting to control it, or if group_notify should never send notifications for unpublished content, even to admin users who could access it.
  2. Make the change.
  3. Upload the patch.
  4. Tests?
  5. Reviews / refinements.
  6. Commit.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 3168128-2.patch3.25 KBdww

Comments

dww created an issue. See original summary.

dww’s picture

Title: Group notify should never send notifications for unpublished nodes » Group notify should never send notifications for unpublished entities
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new3.25 KB

I guess for completeness, we should do the same for comments. ;)

dww’s picture

Issue summary: View changes

Perhaps this should be a config option? I'd rather not have the complication. I think it's better to have this always enforced. But raising it for consideration.

Thanks,
-Derek

gregcube’s picture

Agreed. Lets not notify if the entity is unpublished.

  • gregcube committed 25c5566 on 8.x-1.x authored by dww
    Issue #3168128 by dww: Group notify should never send notifications for...
gregcube’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.