1

I've got a Drupal site with a large amount of CCK fields already populated. I'd like to allow non registered users to be able to submit a particular content type, but I don't want all the fields to be available to them.

I can, obviously, use Content Permissions to do this, but I have 100+ fields that I would need to set individual permissions for, and would also need to set permissions every time I added a new field.

Is there a way I can set default permissions for all fields? So, for example, all fields are editable by admin and viewable by all.

2 Answers 2

0

I think, the module Field Permissions can solve all of your problems.

1
  • Yeah, I'm aware of that module, but it doesn't solve my immediate problem. What I'm after is a way to set sensible defaults for each field, which I can override if needs be, rather than having to set permissions for 100+ fields and having to remember to set permissions each time I set a new field up.
    – Pezholio
    Commented Oct 29, 2012 at 9:16
0

OK, so I'm being lazy here, so I just decided to bite the bullet and install the module. However, I have found a shortcut for Chrome users. Here's what I did:

  1. Go to admin/user/permissions
  2. Open up the Javascript console
  3. Assuming your theme already loads jQuery (which it should if you've got the default theme, type $("input[id*=edit-3-edit-field-]").attr('checked','checked'); and press enter to check all the admin permissions boxes to edit
  4. To allow unauthenticated users to view all fields type $("input[id*=edit-1-view-field-]").attr('checked','checked'); and press enter
  5. Adjust as necessary for the permissions you want.
  6. Click 'Save permissions'

I guess this would work for any other browser with a Javascript console too, but I've not tested it.

It doesn't get round the issue of having to add permissions for every single new field, but I guess it's just something I'll have to live with!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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