By itsme213 on
I understand that I can set up Roles, assign Users to Roles, and enable different levels of access by Node Type for each Role.
However, is it possible to control access at the Node Instance level? e.g. Can I have a:
- role = EventViewers
- role = SocialViewers
- node, say a book node (with subnodes) = Events
- node (with subnodes) = Socials
Now can I set up permissions so that only SocialViewers can see Socials (and subnodes), and only EventViewers can view Events (and subnodes).
If so, do menus and links work appropriately? Links or menu items to Events should only show up in pages for EventEditors. Edit buttons should only show on node instances that the user has edit priveleges for (instead of based on node type).
Thanks for any help.
Comments
I need this kind of functiona
I need this kind of functionality too.
But, unfortunatly, there's no way to figure it out on current 4.4 engine. At least I can't. Anyone?
This is not possibly with Dru
This is not possible with Drupal. You could try my groups.module but it is broken currently. Come back in a few weeks. :p
--
Drupal services
My Drupal services
A few weeks later -- more granular access content permissions
(Disclaimer: maybe I just missed the functionality)
... but it seems that there is still no way to set permissions by the node type. Flipping the access content permission seems to be the only option, and that's not always convenient.
Slightly (but only slightly) off-topic: RSS feeds would also benefit from more granular permissions. Currently, they are tied in with the access content permission.
node api
you can do this in drupal 4.5 and higher using the node access API. see bottom of node.module or the http://drupaldocs.org site
Thanks!
Thank you, Moshe, I got it working.
To summarize:
Reading the code in node.module turned out to be the best way to learn the functionality.
Documentation: http://drupaldocs.org/api/4.6/file/contributions/docs/developer/examples...
Sample code:
http://drupaldocs.org/api/4.6/function/node_access_example_nodeapi
Another helpful thread: http://drupal.org/node/11751
I was confused by documentation for 4.5 at first: it says to insert (0, 0, 'example', 1, 0, 0) into the node_access tables, effectively giving everyone read access again. The 4.6 documentation corrects this: (0, 1, 'example', 1, 0, 0).