0

I have a content type 'new resource'.

I have the form displayed as a page. I would like to make it so that form contains an image field for the admin role, but have this field hidden for any anonymous user filling out the form.

I have been trying to use 'Rules':

EVENTS content is viewed

CONDITION content is of type... Parameter: Content: [node], Content types: new resource AND... NOT User has role(s)... Parameter: User: [node:author], Roles: administrator

ACTIONS Remove an item from a list Parameter: List: [node:field-web-resource..., Item to remove: [node:field-web-resource..

This might be completely the wrong way to do it, and there is a simpler way, or the Rules approach might work.

When I try to add the ACTIONS the dropdown box keeps showing me things like this: node:field-web-resource-image-main:0 (Image) node:field-web-resource-image-main:1 (Image) node:field-web-resource-image-main:2 (Image) node:field-web-resource-image-main:3 (Image)

I'm guessing that this is because I have an unlimited amount of images available for upload in this field.

Any help would be most welcome.

1

You need the field permission module to set permission on the field level.

1

Go to /admin/build/modules/list and enable "Content Permissions" under the cck group.

Then go to /admin/user/permissions. Here under "content_permissions module" section enable permissions for the fields you want to be displayed for authenticated users or anonymous users.

  • Is this D7 or D6? I'm on D7. – njwrigley Jan 30 '12 at 21:13
  • 1
    @njwrigley I'm Sorry, the above answer was for D6. For D7 go to /admin/people/permissions. There under the "node" group, enable permissions for the fields to be displayed for authenticated users or anonymous users. – aerozeppelin Jan 30 '12 at 21:32
  • Thank you for your support. I was after something which would hide 1 specific field with a content type based upon the user role. This did the trick nicely: drupal.org/project/field_permissions. It allows you to set custom permissions within a content type so that, say the image field is not visible on the SUBMIT FORM for anonymous users, but is visible for admins. – njwrigley Jan 30 '12 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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