How to find page which is using specific user group for access

I need to find a way, how to list all pages, which are using specific user group for access.
I have one group called RestrictedGroup. I can list all group members but I would also like to see all pages, where this group is used for controlling the access rights. Is there any trick how to do it?

Note to @evalica: Is this use case taken into account in ? (ie could it be used to list all pages “viewables” by a given user/group too for example?).

@jans: this feature doens’t exist but it can be coded using scripting ( However it’s not very easy to do in a performant way. A quick way (but slow) would to iterate over all documents in the wiki and use an api to check if a given user or group has the permission you want to access it.

For example:

#foreach ($item in $services.query.xwql("where = 'Some.Space' or like 'Some.Space.%'").addFilter("unique").execute())
  * $item - $xwiki.hasAccessLevel('view', 'XWiki.SomeUser', $item)

if this is a common use case, we could implement the feature to support wildcards like (*) in the ‘Location’ input and just add the wanted group in the ‘User’ input.