When using the rules action add access to user, the routine fetches (creates or loads) the acl and adds the user but doesn't add the node. The result is that the ACL doesn't apply to the node. Although the comments state:

    // A following node_save() updates the grants for us.

I assume this refers node_access getting rebuilt?

Attached patch adds the same acl_node_add_acl call as the admin form uses.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greg.harvey’s picture

Title: Rules Add access for user doesn't add node to acl » Rules Add/Revoke access for user doesn't add node to acl
Status: Needs review » Reviewed & tested by the community

Works for me. =)

apaderno’s picture

Title: Rules Add/Revoke access for user doesn't add node to acl » "Add/Revoke access for user" Rules action doesn't add the node to ACL

I would expect the Rules action to call acl_node_add_acl() as the code for the settings page already does.

fago’s picture

Status: Reviewed & tested by the community » Fixed

You are right, committed, thanks!

Status: Fixed » Closed (fixed)

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