Hello,

I was wondering if there was a module or an easy way to set fields to private. That is upon the creation of a CCK designed node you can set if a field is viewable to the general public or only a set of users or nobody.

We wish to be able to associate information with certain nodes we create that we don't always want viewable but on some nodes we may want it viewable.

If a module does not exist that achieves this or close to, any information on how to go about developing a module to do so is appreciated.

Thanks in advance for any help.

Cheers,
Josh

Comments

dkruglyak’s picture

We also should have a way to control for which users the fields will be hidden on view or edit...

Vnaraj’s picture

You might want to try this CCK Field Permissions module
http://drupal.org/project/cck_field_perms

I believe this module will give what you want. I've not tried yet myself but will soon.

hectorplus’s picture

I installed this module, however, i dont see anywhere in the admin page or in the cck module or anywhere else, where to set cck fields private. I even downloaded the latest one(CSV). I disabled it for now.

I am using Drupal RC 2.

Tecito.com
Comunidad Latina en Canada, regístrate ya! Join the growing latin community in Canada.

tdimg’s picture

This is for the 4.7 version, haven't worked with 5 yet.

First go to administer > settings > CCK
You should see a list of content types that you created with CCK
Check the content types for which you want to have permission control, save these setting
Now you can enable permission control for single fields, again save these settings
Then go to administer > access control and look for a new heading: cck_field_perms module
Below that you should find all fields for which you have enabled permission control

Don't know how similar this is to the version for Drupal 5 though. As I said, I haven't worked with Drupal 5 yet, so I don't know.

Joshua Hesketh’s picture

Thank you very much for the replies and useful information. However, the solution I was looking for needs to be node dependent. That is on each node added you can enter in a value (say field foo), but for node alpha you might want to have foo displayed, whereas gamma you may desire foo to be hidden but still in the database.

I hope that makes more sense.

Cheers,
Josh

tdimg’s picture

The Profile Privacy module is the only thing that comes close to what you want, but that only works of course for profile fields and the user can only set it to private or public, while the admin can give user groups then permission to view user profiles.

Maybe, you or someone else can combine the functionalities of those two modules? You might be better off with asking for a feature request in the CCK Field Permission module.