Software engineer, data guy, Open Source enthusiast, New Hampshire resident, husband, father. Fan of guitars, hiking, photography, homebrewing, sarcasm.
Drupal 6: Restrict sections of a form to certain users and roles
At some point you might want to restrict sections of a form to certain users and roles. That can be accomplished relatively easy by creating a module that implements 2 Drupal hooks: hook_form_alter and hook_perm.
First I start by adding the hook_perm():
Next add a form_alter hook:
Now if you enable you module you can restrict permissions by going here: /admin/user/permissions