Field Permissions
The Field Permissions module is a drop-in replacement for the Content Permissions module shipped with CCK.
The key differences are:
- It allows site administrators to set field-level permissions to edit or view CCK fields in any node, and optionally (new feature compared to Content Permissions module), edit field during node creation, and edit or view permissions for nodes owned by the current user.
- Permissions for each field are not created by default. Instead, administrators can enable these permissions explicitly for the fields where this feature is needed.
Additional features:
Requirements:
- CCK (6.x-2.5 or higher): Field permissions requires that hook_field_access() is invoked with $account as 3rd argument (added to CCK in 6.x-2.2, see #336174: Provide a function to restrict view (based on current permissions) of field while using content_format or content_view_field) and $node as 4th argument (added to CCK in 6.x-2.5, see #514452: Add new argument $node to content_access() to enhance the context for hook_field_access()).
Using Field Permissions:
Once Field Permissions module is installed, you need to edit the field settings form to enable permissions for each field where you need this feature. You can enable any of the following permission types:
- Create FIELD (edit on node creation).
- Edit FIELD, regardless of node author.
- Edit own FIELD on node created by the user.
- View FIELD, regardless of node author.
- View own FIELD on node created by the user.
Use these options to enable role based permissions for each field. When permissions are enabled for a particular field, access to this field is denied by default and explicit permissions should be granted to the proper user roles from the permissions administration page. On the other hand, when these options are disabled, field permissions are inherited from node view and/or edit permissions. In example, users allowed to view a particular node will also be able to view this field, and so on.
Upgrade path from Content Permissions module (part of CCK) to Field Permissions:
The Field Permissions module is fully compatible with the permissions already defined with Content Permissions module shipped with CCK.
- Make backups to ensure you can easily fallback in case of any trouble.
- Install Field Permissions module while Content Permissions module is still enabled.
- Disable and then Uninstall Content Permissions module.
- You can now check your existing permissions are still there, in the Permissions administration screen.
- Now, you may wish to disable permissions for fields where this feature is not really needed.
Background and why this module exists:
- Edit own field permission (issue in the CCK queue marked as won't fix for CCK/D6).
- Field Permissions in Core (D7) (feature delayed until D8).
