Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have pages A, B and C. I also have users 1, 2 and 3. I would like for user 1 to only have access to pages A and B, user 2 to only pages B and C, and user 3 to only pages A and C. How can i do that? is there any module available for that? Note that My site will obviously have more than 3 pages and, hopefully, I'll have more than 3 users. As such, I cannot create roles or groups for every page/user access permutations.

EDIT:

I have a custom table having fields user-id and page-id. I need to control the page access based on this relation.

share|improve this question

closed as too broad by Mołot, Anil Sagar, Free Radical, Bala, kiamlaluno May 4 at 15:23

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
This question appears to be off-topic because it is about using a custom-coded table, and OP did not show the code he is using, or the part of the code that is relevant for the question. –  Mołot Mar 28 at 7:31
add comment

2 Answers 2

up vote 2 down vote accepted

https://drupal.org/project/nodeaccess_userreference

Gives content access permissions to users for content that references the users with User reference or Entity reference.

This is great if you want your content authors to be able to choose additional authors, or choose who can view their content, as well as being able to display the list of authors or viewers within your content, or in views displays.

share|improve this answer
    
thank you.. it worked. –  user3465250 Mar 28 at 9:17
add comment

You need to use content access along with Acl module...

Project page says

This module allows you to manage permissions for content types by role and author. It allows you to specifiy custom view, edit and delete permissions for each content type. Optionally you can enable per content access settings, so you can customize the access for each content node.

enter image description here

You also need to use ACL

The ACL module, short for Access Control Lists, is an API for other modules to create lists of users and give them access to nodes. It has no UI of its own and will not do anything by itself; install this module only if some other module tells you to.

enter image description here

share|improve this answer
    
thanks for the reply @anil but i cannot create roles everytime i add a content. I need to control the access using specific users and not roles. –  user3465250 Mar 28 at 6:06
    
Yes, ACL supports specific users.. You see in second screenshot .. You can add individual users to provide access.. –  Anil Sagar Mar 28 at 6:07
    
Sorry that i forgot to mention about the custom table with fields user-id and page-id. I need to control the page access based on this relation. Is there a way? –  user3465250 Mar 28 at 6:33
    
Why do you need above relation ? Since above relation is going to be created once you add users to content ? –  Anil Sagar Mar 28 at 6:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.