xif-fr / dokuwiki-plugin-catlist

DokuWiki plugin to list pages and namespaces recursively in nested lists
https://www.dokuwiki.org/plugin:catlist
8 stars 15 forks source link

Not displaying restricted namespace items #31

Closed ghost closed 5 years ago

ghost commented 5 years ago

Distantly related to https://github.com/xif-fr/dokuwiki-plugin-catlist/issues/1

Hi, I run a wiki with a private namespace where registered users have read-only rights and non-registered users have no rights. ACL is as follows:

*   @ALL    1       # Everyone can read everything by default.
private:*   @ALL    0   # No one can read from the private namespace...
private:*   @user   1   # Except registered users.

On the main wiki page, I would like non-registered users to still be able to see the list of items in the private namespace - just not be able to access them. The _plugin»catlist»hide_aclnsnotr global option is unchecked. The main wiki page (at the root, accessible by non-registered visitors) includes the following syntax:

<catlist private: -noHead -forceHeadTitle -columns:3 -sortAscending -sortByTitle -noAddPageButton>

EXPECTED BEHAVIOR:

The syntax above should display the contents of the private namespace, even to non-registered visitors.

OBSERVED BEHAVIOR:

The contents of the private namespace are hidden from visitors, and shown to registered users. I believe I have occasionally been able to see the list as a non-registered visitor after logging in and out, changing browsers, etc. but this was inconsistent and I can no longer reproduce it.

Thank you for your help. Happy to give you user access to the wiki if you'd like to see for yourself.

xif-fr commented 5 years ago

Hi, this is probably a bug of some sort. I'll first try to reproduce it, and if I don't see that, it will be useful to have access to your wiki.

ghost commented 5 years ago

Hello, pinging this after a month to check for any update on the issue. Thank you!

xif-fr commented 5 years ago

Sorry, I did not have time to reproduce it. Seeing the bug on your wiki would definitively help.

ghost commented 5 years ago

Sorry, I did not have time to reproduce it. Seeing the bug on your wiki would definitively help.

Hi Felix, thank you for your reply. I have added you as admin to the wiki (there is nothing confidential in there) and you will have received a separate notification with the credentials. The start page (index) is what contains the catlist tags. Thanks again for your help!

xif-fr commented 5 years ago

Ok, I see. This is not a bug, but simply a new option I will implement. hide_acl_nsnotr is about namespaces only (very misleading description indeed…). I've added -ACLhideNs and -ACLshowPage options on the plugin page.

xif-fr commented 5 years ago

I've updated the plugin on your wiki and added the -ACLshowPage flag. This does not seem to do anything for the moment, but I guess this is just a caching issue. On my wiki, it works (see the page "Truc Muche Bidule" on https://wiki.xif.fr/index ). You can delete my account if it finally works. If not, we'll have to understand why…

ghost commented 5 years ago

Hi Félix, thank you for making the time to follow up.

If a caching issue is preventing the display of the links, I've been unable to fix it. I've added the ~~NOCACHE~~ tag to the main page, and manually purged the cache by adding &purge=true at the end of the main page's URL - both to no avail.

My workaround, for now, has been to (i) create an index page underneath each private namespace, (ii) make that index page readable to @ALL through the ACL Manager, and (iii) activate the show_leading_ns option in the global catlist configuration. As a non-registered user, I can now see the list of all pages (without links) under the private namespaces (i.e. the desired behavior).

I further tried hiding the newly-created index pages to avoid them cluttering the list of pages by using the -excludeOnName -exclupage:"^index$", but this has the effect of negating the show_leading_ns option and results once more in the list of pages being hidden. So I have removed that syntax.

In summary, I don't understand why the list of pages that users don't have access to does display correctly on your wiki (the Truc Muche Bidule example) but not on mine. I don't want to be a burden (and you've already been very graceful in helping so far), but if you have further ideas, I'm interested. Thank you!

Edit: I further hacked it into the desired behavior by adding -excludeOnName -exclupage:"^index$" to the individual index pages from each private namespace, and transcluding them into the main page. I can now see the list of all private pages as a non-registered user, without the link to the namespace index pages. It's a workaround but it gets the job done for now!

xif-fr commented 5 years ago

Well, I simply messed up. Thank you very much for pointing me the index-page-workaround, this allowed me to see the bug immediately. Could you try the latest version ?

ghost commented 5 years ago

Hi Félix,

I replaced syntax.php on my site with the one freshly pulled from your github repository, and reverted my main page to just <catlist private: -noHead -forceHeadTitle -columns:3 -sortAscending -sortByTitle -noAddPageButton -ACLshowPage> as before.

It works perfectly well now! Even as a non-registered user, I can see the list of all pages (without links) as per desired and expected behavior. I no longer need my hackish index pages trick.

Well done and thank you very much for solving this issue so promptly!

xif-fr commented 5 years ago

Merci, bonne continuation. Vous pouvez évidemment supprimer le compte que vous m'aviez fait.