Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Entity Visibility Preview

Security covered

Part of the Entity ecosystem · 235 projects

View on drupal.org

Synopsis

This module provides a new field type: entity visibility condition.

This new field allows to control the access to content entities (view operation not on admin routes). A plugin system allows to add new condition type.

Warning! The module implements hook_entity_access() so the access is checked only when this hook is triggered, for example on the page of a node. So if the content is displayed using a view for example, there is no access check.

A generic implementation of node_access hooks can't be done (if you have an idea on how to do a generic implementation open an issue and provide a patch ;)).

For now you are able to:

  • Add a new type field Entity Visibility Preview
  • Configure the field with selected plugins
  • Global configuration form
  • Preview the website depending on conditions

Use case

Add an entity visibility preview field on paragraphs. Contribute paragraphs with different date ranges and taxonomy categorizations. That way you can have a content displayed differently depending on time and the user categorization.

Entity Visibility Preview Simple Grants submodule

The Entity Visibility Preview Simple Grants submodule integrates the Entity Visibility Preview module with grant API.

Using the submodule will allow node lists (entity query, Views, Search API) to check permissions of current user according to taxonomies / current date.

The module works using the "preview" form of the Entity Visibility Preview module.

Warning! The Entity Visibility Preview Simple Grants submodule only connects the taxonomy condition and date range condition plugins with the grant API. Any other access plugin must be handled manually.

Demonstration

Watch a demonstration video

Requirements

Each condition plugin can require different modules, if the requirements are not satisfied the plugin doesn't show up in the field settings.

The Taxonomy condition plugin needs the following modules:

  • Taxonomy (Core)

The Date range condition plugin needs the following modules:

  • Datetime (core)

Configuration

  • Enable the Entity Visibility Preview module on your site.
  • Add an entity visibility preview field to an entity type.
  • Select the required visibility condition plugins on this field instance.
  • Configure if needed the plugins in the field settings.
  • Go to one content entity edit form where the field is added and configure visibility for this content.
  • Go to the configuration page (/admin/config/content/entity_visibility_preview/settings) and choose your module settings.
  • If you use the taxonomy condition plugin, you can go to a specific configuration page (/admin/config/content/entity_visibility_preview/taxonomy_condition) and choose your anonymous settings for each field on each entity type.
  • View your entity with the specific condition you just configured.

Credits

SVG icon eye.svg taken from Iconfinder and then modified.

Maintainers

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Feb 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
2.0.x-dev Dev Jun 25, 2024
8.x-1.10 Stable Jun 19, 2024
8.x-1.9 Stable Feb 27, 2023