In my interface, I user function document.
if( document(tofolder(local!documentId), "size") > 0, true, false )
Discussion posts and replies are publicly visible
Where / how is the value of "local!documentId" being set?