Topic on Extension talk:Semantic ACL

Query for accessible pages/files

6
Summary last edited by Tinss 18:48, 18 February 2020 4 years ago

Filed an RFE. Implemented in most recent version.

Smith.dan (talkcontribs)

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?

Tinss (talkcontribs)

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?

Smith.dan (talkcontribs)

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...

Tinss (talkcontribs)

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.

Tinss (talkcontribs)

I've made a patch adding the feature you requested. Any chance you can take it for a spin soon?

Tinss (talkcontribs)

I decided to go ahead and approve the change. The most recent version of the extension includes the patch.