XWQL - Filter Viewable


I’m trying to write some XWQL to get a list of documents with a specific parent. Not sure if XWQL is the best way to do this in the first place - open to suggestions!

I would like this query not to return documents that the current user does not have permission to view. Is this possible?

I know you can do it in the document tree with the showOnlyViewable property, but I need the raw document objects in velocity so I can generate a custom layout with them.

Many thanks!

Fixed it :slight_smile:

I just try to get the document ($xwiki.getDocument) and check if that’s null. If it’s null, the user doesn’t have permissions to view!

1 Like