Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Entity Field Privacy (EFP) is a fork of User Field Privacy (based on Ghostthinker's fork called User Field Access found at https://drupal.org/sandbox/Ghostthinker/1691678). It provides the same kind of functionality, but can be applied to any entity type, not just users.

EFP provides the developer with a means to enable an option for any fields of configured entity types that allows the user who creates or edits entities of that type to set a privacy level for those fields. This privacy level determines who can see the value of that field. The privacy settings are saved per field per node. The privacy setting for any field can be changed at any time by any user with permission to edit that entity or entity type.

The admin configuration for the module allows the developer to set which entity types can make use of EFP. When editing a field instance for any of those entity types, the developer will have a checkbox to enable the privacy settings for that field. When a user then creates or edits an entity of that type, a privacy setting drop-down will be displayed next to that field.

By default, EFP is not enabled for any entity types, so the first thing you must do is configure it. You can also set which privacy level will be the default, which is a global setting for all entity types.

EFP provides two permissions:

  • Bypass entity field privacy - users with this permission can see all field values regardless of their privacy setting
  • Administer entity field privacy - users with this permission can configure EFP

EFP provides two privacy settings out of the box:

  • Private - only the author can see the field value (or users with the Bypass EFP permission)
  • Public - everyone can see the field value

EFP can also be easily extended by other modules to provide additional custom privacy levels, with whatever logic or permissions you want to use to determine whether or not a field value can be viewed by the current user. The attached screenshots were taken from a site that demonstrates this feature. It has a custom module providing an "Internal" privacy setting.

This module will make use of the MS-Dropdown library by Marghoob Suleman to make the selects into pretty drop-downs with icons, if it's present.

Download MS Dropdown Here

You must rename the extracted folder to "ms-Dropdown" (case-sensitive) and put it in sites/all/libraries. If this is not available, the widget will just be a normal form select. Note that EFP provides a bunch of CSS tweaks to the drop down. It can be further tweaked by adding CSS overrides in your theme.

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • Module categories: Access Control
  • Created by teknocat on , updated