Set Permission for one page / node

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
mayur.pimple's picture

Hi

I have create home page. Other pages Created in same content type.

If i want to set permission for only 1 node or 1 page then
How to set permission for edit delete .

is it Any module to solve this issue?

I have used nodeaccess, node privacy by rule, content access modules. and also get one solution using phptemplate_preprocess_page . but i need module.

Comments

Check hook node grants

mehuls's picture

Check hook node grants

When a node is saved, a module implementing hook_node_access_records() will be asked if it is interested in the access permissions for a node. If it is interested, it must respond with an array of permissions arrays for that node.

$record = array(
  'nid' => 0,
  'gid' => 888,
  'realm' => 'example_realm',
  'grant_view' => 1,
  'grant_update' => 0,
  'grant_delete' => 0,
);
drupal_write_record('node_access', $record);

And then in its hook_node_grants() implementation, it would need to return:
if ($op == 'view') {
  $grants['example_realm'] = array(888);
}

Use menu access callback for particular page if you want to set permissions for one page.

Hi Mayur, Please refer this,

rachit_gupta's picture

Hi Mayur,

Please refer this, https://drupal.org/node/529010 . Also best way to get the help from community is by posting the query in right channel, look for relevant topic on Drupal forum, you can also avail IRC support which is quick and fast. relevant links are given below. You can also search for the issue, most of the time you will find tried and tested solutions already existing.

Forums: https://drupal.org/forum
IRC: https://drupal.org/irc

Cheers,

Rachit Gupta
Founder DrupalMumbai, DrupalCAP.org
rachit.gupta@drupalmumbai.org

Quick answer

trainingcity's picture

Although @rachit_guta makes an important point, I wanted to give you a quick answer here. You can check out the node access module. It may do what you need:

https://drupal.org/project/nodeaccess