Score:0

Using Tac Lite in combination with Paragraphs

ma flag

For our new Drupal 9 (or 8 if necc.) website we require a very fine controllable access structure where we can give and restrict access on a user by user basis. Not only for a content type but also for the paragraphs (or more atomic components of a page). With Tac Lite we can already set the permission via taxonomy terms on a user bases to view a node. But now we would like to also controll single paragraphs within that node.

What we would like to achieve is a structure like:

User 1: Has access to content types / nodes with permission "NodeA". Has acess to paragraphs marked with permission "ParagraphA".

User 2: Has access to content types / nodes with permission "NodeA". Has access to paragraphs marked with permission "ParagraphB".

User 3: Has no access rights

from there we would create a Node with content where we can set the following:

  1. We can set the node permissions to have "NodeA" (this works with Tac Lite)
  2. We can add some basic node contents (that are not part of any paragraph)
  3. We can add a paragraph p1 and set its permission to "ParagraphA"
  4. We can add a paragraph p2 and set its permission to "ParagraphB"

What should happen is:

  1. User 1 can view the contents of the node and can see the p1 paragraph but not the p2
  2. User 2 can view the contents of the node and can see the p2 paragraph but not the p1
  3. User 3 can't see the page at all

With the paragraphs module it is possible to restrict access to paragraph types via roles but this presents some problems with what we would like to achieve.

  1. Its based on paragraph type, not the instance of that type on a node.
  2. Its based on user roles, which in our case is not an option as we would need 100s of roles.

We are not sure if paragraphs is the way to go. Or if there are other ways to achieve this structure. But we would like to be able to mix and match content types together like it is possible with paragraphs.

Would there be a way to add this functionality via a custom module to extend the paragraphs of tac lite module? Or are there other modules which could do better?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.