I'm looking for a reliable solution for the following situation:
- a membership site with multiple levels of access for users (based on roles, say anonymous, and levels 1 through level 4)
- need to restrict node view access by role on a per node basis, but allow anonymous access to the teaser (should be possible to show/restrict other fields as well)
- take performance and flexibility into account
There are several modules that solve most of the problem, but not entirely. I'm looking for recommendations on the combination of modules to use, and whether I'd need to extend any of these with custom code or if just combining contrib modules is feasible.
- Premium content offers the basic functionality, but it seems to only work for the regular body field. Is it still a good option if you want to publically show or restrict other fields? (e.g. restrict the body as well as another text or file field).
- Taxonomy Access Control: I like how you can easily change the access level per node by just changing the assigned taxonomy term. But how would I allow anonymous access to the teaser or other fields?
- Field permissions offers all the granularity on the field level I would need, but I need the option to restrict one field (e.g. node body) to different roles on a per-node basis.
- Or maybe do something with Panels (cf. this answer)?
A solution that plays nice with other modules (e.g. Views) is preferred (I think TAC would qualify here - e.g. filter by taxonomy, maybe use VBO for changing terms...).
How would you do this?
Update: I've looked into using Panels; whle I like the flexibility that a Panels-based approach offers, I doubt it's feasible for my use case.
Using Panels, the selection rule would have to be based on a combination of current user's role and node being viewed's term id, so for each selection rule you'd need 2 criteria and the 'All criteria must pass' setting. So each access level (except 'Anonymous') needs two variants: one for the combination of tid + roles that get to view the teaser, and one for tid + roles that get the full node.
Since there are 5 roles to take into account (anonymous + roles A, B, C, D) I'd need 9 page variants. This doesn't feel quite elegant, or would 9 variants be acceptable? (thinking about performance, maintainability etc.).
Another problem is that the Term ID criterium in the selection rule is per Content type, so if I wanted to use this for multiple content types I'd need even more variants. Since I need the 'All criteria must pass' setting for the combination of role and term id, I cannot add term id of two content types in one selection rule.
Another option would be to use PHP for evaluating the selection rule, but that feels like it may be defeating the purpose of using Panels. And code in DB is not a good idea, etc.
So unless I am overlooking a simpler way with Panels, it doesn't seem such a good idea (except maybe with custom PHP for selection rules...)?