Difference between Rabbit Hole and Private content?

Created on 15 April 2025, 5 months ago

Problem/Motivation

I had a look at Rabbit Hole โ†’ and Private Content โ†’ , and they seem to offer the same features, like hide a content type or a node ...

Steps to reproduce

Look at Private content and Rabbit Hole, and not being able to tell which one to use ...

Proposed resolution

Perhaps add a simple table on the Private content project page, listing the differences between Rabbit Hole and Private content?

If they are virtually identical, merging the two projects could be considered?

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Active

Version

2.0

Component

Miscellaneous

Created by

๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ressa
  • Status changed to Closed: works as designed 3 months ago
  • ๐Ÿ‡ต๐Ÿ‡นPortugal jrochate

    I'm afraid you have misunderstood one or both modules:

    Rabbit Hole is not an access module as Private Content.

    For that reason they could never be similar or even merged.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Sorry, but you're wrong. Rabbit hole is very much an access module.

    Either way, the differences between the two modules could be listed, as I suggested, so that's still active.

  • ๐Ÿ‡ต๐Ÿ‡นPortugal jrochate

    Well, I do not intent to keep discussing this, because I can see you are a long term Drupal developer (much more than I), so I will just detail a little more my first reply, and I hope I can contribute to anything. If not, we're ok anyway :)

    Rabbit Hole is primarily about controlling what happens if a user visits the canonical entity route. It is not true access control: entities remain accessible to code and APIs unless you add custom restrictions.
    - Typical technical use: Override EntityViewController, subscribe to route events.

    Private Content modifies the Drupal access system at the entity level, including Views, APIs, and entity queries.
    - Typical technical use: Implements hook_node_access() or custom AccessCheck classes for robust access control.

    That's what I referred to when I said about "an access module".

    Rabbit Hole Primary API Usage
    - Entity API, Route Subscriber, Entity View Controller, Event Subscribers

    Private Content Primary API Usage
    - Entity Access API, Permissions API, Node Grants API, Route Access Subscribers

    On my point of view, Rabbit Hole:
    - Purpose: Controls what happens when someone tries to access an entity (like a node, user, or taxonomy term) directly by URL.
    - Common Uses: Prevents direct viewing, redirects users, or returns 404/403 responses for certain content types or entities. Itโ€™s often used for content thatโ€™s not meant to be viewed as a standalone page (e.g., referenced content, system content).
    - Visibility Control: Indirect. It doesnโ€™t manage content privacy but rather controls how entities are displayed (or not displayed) at their URLs.

    And Private Content
    - Purpose: Restricts access to specific content for certain users or roles.
    - Common Uses: Hides content from anonymous or unauthorized users, allowing only specified users/roles to view it. Useful for members-only content, confidential documents, etc.
    - Visibility Control: Direct. It manages who can or cannot view the content based on permissions.

    Cheers.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Thanks for laying out the technical differences between the two modules as you see them.

    It seems to me, that the dividing point is how we understand the meaning of the word "access", since it can mean different thing to different people ...

    My perspective was, that as an end user, after reading the intro text from both modules, it looked like they did more or less the same, or at least with some overlap.

    My main goal is to make it easier for users looking for a "hide node(s)" solution, to more easily decide whether to use this or the other project, by adding a sentence or two, or a table on the project page, outlining the difference between the two projects. The merging comment was more like a afterthought ...

    I'll update the Issue Summary to emphasize my intention with the issue: To clarify the differences between the two modules, maybe describing scenarios where to use one, or the other.

    PS: Even if my account were created yesterday, I think we should try to keep a welcoming and positive tone towards everyone, and avoid sentences like "you have misunderstood" -- I think it's more constructive, and promotes and all round more friendly environment here on drupal.org :)

Production build 0.71.5 2024