Guillaume Lerouge wrote:
The point seems to be how $bbdoc is assigned within the control
structure #foreach. Does this make sense for you? Thanks!

I must admit I have no idea why the code behaves this way, but since your code apparently works better than mine I updated the XAR using it :-) -> if it works let's use it ;-)
Thanks! After all this is about collaboration!

The point is that $bbdoc gets the value of the first granted document, let's say com.xpn.xwiki.api.Document@ab18cf, and this is the value used for the no-granted entries from this point onwards. It will be great to know why does this happen. Let's hope others have sometime to jump in here and solve the doubt.

Cheers,

Ricardo
-- 
Ricardo Rodríguez
Your EPEC Network ICT Team