Hi. In D6 version, one could grant permissions in code by doing something like this:

$settings = array('ops' => array('view', 'update'));
$account = user_load($user->uid);
content_access_action_acl_grant_access($node, $account, $settings);

This was used for granting access to a node based on various criteria e.g. user, role, etc.

Please what is the D7 equivalent for doing something similar? I could not find relevant documentation. Thanks.

Comments

zeezhao created an issue. See original summary.

gisle’s picture

Status: Active » Closed (outdated)

This issue has not received any updates in the previous 3 years. If you believe it to still be relevant, you are encouraged to reopen the issue and update it.

If you got an email about this Issue status update, it is because you at one time (possibly a very long time ago), subscribed to it. To learn how to unsubscribe yourself, please visit: https://www.drupal.org/project/webmasters/issues/3142987