I've an entity that models a contact (I'm using RedHen CRM) and obviously I can fill the data from the usual admin form. But if I want to publish another form for non admin users to insert their data and with less fields displayed, which module (or solution) can I use? I'm using webform, but I'm having some trouble with addressfield...

1 Answer 1


I don't know about the webform solution/Redhen

but programmatically/basic drupal speaking I would just use HOOK_form_FORM_ID_alter to restrict access to certain form elements based on role/permission. Find the id of the form and have a look at the array via devel or something similar, every field normally has an '#acces' variable already included. Setting those to 0 for the fields does exactly what one expects it would do.

This way you can re-use the standard form for all purposes instead of adding a second one. So future edits to the entity fields will automatically be added to all forms and you don't have to fiddle around with all sorts of secondary processing in the submit handler.

  • I like your solution, but the drawback is that I have to give the permission to create/update/delete contact, while I want only to give the first one, unless I hack the original module by splitting the permissions.
    – alez
    Commented May 13, 2015 at 14:21

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.