开发者

Drupal User Permissions, Only Allow Specific Users to Edit Specific Pages

开发者 https://www.devze.com 2023-01-03 05:49 出处:网络
I know I can set up a role to allow user\'s to only edit their own pages, then go mark the appropriate pages to be authored by the appropriate user. But then I run into multiple users per page problem

I know I can set up a role to allow user's to only edit their own pages, then go mark the appropriate pages to be authored by the appropriate user. But then I run into multiple users per page problems.

Is there any way that you can explicitly only allow a user to edit certain (perhaps multiple) pages, while accounting fo开发者_运维问答r overlap in the case that more than one user may be allowed to edit the same page?

Thank you


This would be fairly complex to do programmatically, but a fairly easy solution is to create a vocabulary to apply to the pages and then use the taxonomy access control module: http://drupal.org/project/taxonomy_access to set the permissions based on terms.


I answered a similar question a few months ago, with an overview of implementing a few different access scenarios:
How do I give a specific user editing rights to a specific node?


If you just need a module that set the access permissions of a user to a node of a specific content type, then use http://drupal.org/project/content_access; if the content type is a book, then you can also try http://drupal.org/project/book_access.
Remember that installing different modules for access control should be avoided, as they tend to conflict each with the other.

If you have patience, then you can create your own custom module, and implement hook_node_access_records() and hook_node_grants() as suggested by Jeremy.


try http://drupal.org/project/coherent_access

or http://drupal.org/project/content_access

this ish is crazy!@!!!@!@!


This is also possible to do programatically using hook_nod_access_records() and hook_node_grants().

With hook node_access_record create a relm with the UIDs of the users you wish to allow. and in hook grants create a grant with the users uid in the same relm. It is not that scary and very flexable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号