Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Content Access should have an api.php file which holds the API for other modules contributors who which to use it.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1145984-content_access-api_documentation.patch | 1.12 KB | bradjones1 |
|
Comments
Comment #1
good_man CreditAttribution: good_man commentedUsecases:
#1022344: Hide snippet on nodes with restricted access
#1039654: Filter nodes on static role access
#876928: User friendly binary on/off switch?
#498892: Setting individual node permissions in PHP
#796868: Lock or Freeze a node from further edits
Comment #2
Vacilando CreditAttribution: Vacilando commentedSubscribing.
Comment #3
Kolibri CreditAttribution: Kolibri commentedPlease tell me how i can grant a user update-rights for a single node (via user and node id)
I detected the changes in the acl, acl_node and node_access table.
But i don't understand the serialization(a:6:{s:4:"view";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}s:8:"view_own";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}s:6:"update";a:1:{i:0;i:3;}s:10:"update_own";a:1:{i:0;i:3;}s:6:"delete";a:1:{i:0;i:3;}s:10:"delete_own";a:1:{i:0;i:3;}})
in content_access.
I want to change the permission after editing a node, with node_presave. I tried to do it with rules, but the content-selector is unable to retrive the node-id, which i need.
Thanks a lot
Comment #4
jlockhartNot sure if others are still looking for this but I was able to use form_alter to add my own submit function on the node form. In that function I used
content_access_save_per_node_settings($node, $settings); content_access.module line 372.
andcontent_access_get_per_node_settings($node); content_access.module line 404.
. I'm using it to allow clients to make their photo gallery public or private. Hope that helps.Comment #5
bradjones1See attached; note it includes some edits I've made to hook_user_acl() and other API functions related to rules implementation, here.
Comment #6
gisleI intend to add this, but it should have more eyeballs on it. Please go ahead and review it.
Comment #8
gisleCommited to 7.x-1.x-dev