I have multiple uses for this functionality now but mainly for a private message system.
What I want to do:
- Configure a content type with an entity reference to users
- Create nodes of that type and select multiple users using the entity reference field
- Limit visibility of each node of that type to the users selected in that field
I believe there was a module for this in D7, though I can't find it now. But I've had no success finding one for D9.
Is there a module or set of modules anyone is aware of that could provide this kind of access control?
If a module was to be built, any suggestions for best way to approach it? (Is it a really bad idea to put some conditional logic in a template... "if logged in uid = one of values in field x, print, otherwise don't" ? (I don't know the twig syntax for that))
(Since I mentioned private messages, I'm aware of the D9 PM module. But for a lot of reasons, I'd rather just use nodes and comments system. The node+comment system is already well developed and the only thing missing really is multiple-user visibility control.)