Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Cms 2.1.4 Update released for Drupal core (2.1.4)! Release: Drupal 12.0.0-alpha1 First alpha version released for Drupal core (12.0.0-alpha1). Release: PhotoSwipe - Responsive JavaScript Modal Image Gallery 5.0.9 Minor update available for module photoswipe (5.0.9). Release: AI (Artificial Intelligence) 1.4.8 Minor update available for module ai (1.4.8). Release: AI (Artificial Intelligence) 1.3.13 Minor update available for module ai (1.3.13). Release: Moderated Content Bulk Publish 2.0.53 Minor update available for module moderated_content_bulk_publish (2.0.53). Release: Mailchimp 2.2.9 Minor update available for module mailchimp (2.2.9). Release: Mailchimp 3.1.4 Minor update available for module mailchimp (3.1.4). Module Revived: Image field to media 3.0.2 Module image_field_to_media updated after 13 months of inactivity (3.0.2). Security Coverage: Analyze PostHog Module analyze_posthog now has official Drupal security advisory coverage.

Entity is Public

Security covered Drupal 10–11

Part of the Entity ecosystem · 221 projects

View on drupal.org

This module provides a simple way to check if an entity is publicly accessible, going beyond just anonymous user access. It considers factors like whether the entity has a valid, non-administrative path and can optionally check for URL aliases. It also offers an API for other modules to contribute to this accessibility check.

Adds a simple API to determine if an Entity is publicly accessible or not.

/**
 * Determine if an entity is publicly visible.
 *
 * @param string $entity_type
 *   An entity type of $entity.
 * @param object $entity
 *   The entity object.
 * @param array $options
 *   An optional array of options to use when determining publicity.
 * @param array $data
 *   An optional array of additional data to use when determining publicity.
 *
 * @return bool
 *   TRUE if the entity is publicly visible, or FALSE otherwise.
 */
function entity_is_public($entity_type, $entity, array $options = array(), array $data = array())

This goes beyond simply checking entity_access() as an anonymous user, but also checks other conditions like the following:

  • Does the entity actually have a URI? Is the URI the frontpage path or a non-administrative path?
  • An optional check for requiring the entity to have a URL alias.
  • Is the entity going to be processed with the Rabbit hole module?

The module additionally provides an API for other modules to help determine if an entity is publicly accessible or not.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0 Stable 10–11 Jun 5, 2026
1.0.x-dev Dev 10–11 Jun 5, 2026
1.x-dev Dev 10–11 Jun 4, 2026