Hello,

I've been searching and have found some useful information about user access control.

As a drupal site admin I want to create a page/node for a client's project and have that page/node accessible to that client only.

So the client could log in and post comments or just view the page but regular users and other clients could not access this same page.

I've seen methods of doing this by creating a role for each user and defining access to that role for a certain page. Which would work but it seems like a awkward way to do "private nodes" or "pages" and could get messy with 100+ roles.

Is there anyone out there who has used this functionality in a drupal site?

Am I thinking about this in the wrong way?

Is there any simple way to achieve "private client pages" based on users not roles...

This seems to be what I want to do.

http://drupal.org/node/24073
"privacy by user"

Thanks for any suggestions.

Comments

cog.rusty’s picture

Two possible solutions for access control by user and by node are

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

Another simpler solution is http://drupal.org/project/private where the author gets a check box to hide the node.

internets’s picture

I installed the "private" module
http://drupal.org/project/private

I may not be using this correctly. The method I see for making a page private for a single user and site admins is to do this process:

log in as admin
create the user with a role that has permissions to create a page
log out of admin account
log in as the newly created user
create a page
tick the "private" check box
then there is a private page that is accessible only to the user who created it and the admins or any role that has permission to "view private pages"

This works, But I would like to have something where the user does not have permission to edit / create a page. I just want the user to log in, view the private page for that individual user and post comments. The admin would have control of page creation / content.

It seems kind of unintuitive to go through the above process to make a "private" page for a single user.

Maybe I'm using this module incorrectly? Any suggestions welcomed.

Thanks

cog.rusty’s picture

Oh, I see. The page is not actually created by the user, but the "private" module is intended for use by the author. And what you want to control is who can post comments.

I think there is a workaround.

First, in /admin/user/access, don't give the role of those users "create", "edit", or "edit own" permissions for that node type.

Then, whenever you create or edit a page of that type, you (or someone with "administer nodes" permission) can
- set that user as the author of the node and
- tick the "private" check box.

So,
- they can see their own "private" node since they are the author, but they can't edit it
- if that node type allows comments, only the "author" can see the node to post comments.
I haven't tested it but it should work (unless if the last step, posting comments, fails because of the permissions).

Otherwise you would need to look into the other available access control modules, or other solutions involving book child-pages instead of comments.

Mguel’s picture

subscribe