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:
- We can set the node permissions to have "NodeA" (this works with Tac Lite)
- We can add some basic node contents (that are not part of any paragraph)
- We can add a paragraph p1 and set its permission to "ParagraphA"
- We can add a paragraph p2 and set its permission to "ParagraphB"
What should happen is:
- User 1 can view the contents of the node and can see the p1 paragraph but not the p2
- User 2 can view the contents of the node and can see the p2 paragraph but not the p1
- 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.
- Its based on paragraph type, not the instance of that type on a node.
- 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?