I've got some SMW queries that display image thumbnails and that just show a page link where the image is inaccessible to the current user. Is there a way to filter these queries, so they only select accessible images? If not, is this a feature that could be added?
Topic on Extension talk:Semantic ACL
What you seem to want is a page property that informs whether a page is visible to the current user or not. Am I correct?
Can you give me an example of a query?
Yep.
{{#ask: [[Category::Photo]] [[is accessible::true]] }}
Problems with this are 1) the most natural way to do it is with a negation, ![[is restricted:true]]
, which isn't supported, and 2) not sure there's any infrastructure for queries whose results change depending on the current user. So maybe not easily achievable...
Adding the is_accessible
system defined page property is easy. There probably is a way to capture with a SMW hook which property is being queried and prevent MediaWiki from caching the page when is_accessible
is detected.
Can you create a feature request in Phabricator? I'll try to implement this next time I do some maintenance and improvements on the extension.
I've made a patch adding the feature you requested. Any chance you can take it for a spin soon?
I decided to go ahead and approve the change. The most recent version of the extension includes the patch.