I have a need to filter values (for display) in a multigroup based upon a users role. I was hoping someone could point me in the right direction on the best way to accomplish this. Are there any existing contrib modules anyone is aware of that would support this functionality?
The approach I was planning to take is as follows:
1) Add a select field to the multigroup that will specify a role capable of viewing each particular multigroup delta
2) Writing a custom module implementing hook_nodeapi to check for role permissions and only displaying deltas matching the users role
Alternatively, I was considering using views to limit the values list (and using CCK View Field or something similar) -- this would require less custom work, but I'm not sure if I can filter a CCK Field containing a role name against a users current roles -- is this possible?
Comments
Comment #1
markus_petrux commentedI would suggest using custom code to remove the rows in a multigroup that do not match the proper user role.
Note that each field in a multigroup is stored in a separate table, so if you use Views, you'll have here a few joins. On the other hand, CCK has already loaded the fields in the $node object during node_load(), and CCK uses caching to optimize that, so processing the fields using custom code would be faster that using Views.