Turn off user watchlist

Hi all - I’d like to be able to turn off the ability to add specific pages to a watchlist. Has anyone tried this / had any success?

Hello,

as far as I know it’s not possible to completely prevent this. There’s at least 3 different mechanisms for the watchlist:

  1. the switches button under the notification bell allowing to watch wiki / space / page
  2. the autowatch mechanism from the notification settings: based on it a user editing a page will automatically watch the pages
  3. the custom notification filters: available from the notification settings, those filters are created automatically when using the switches and the autowatch, but you can also create custom ones from there to watch pages with specific filters

The easiest for you to prevent such thing would be probably to act on frontend:

  1. disable from the global notification settings the autowatch for all new users (be careful it’s only applied for new users, not existing ones)
  2. customize the notification setting sheet to prevent changing the value of the autowatch and to prevent adding a custom notification filter
  3. customize the sheet that displays the switches to only display it for not-protected pages

Globally it’s not easy and I wouldn’t recommend such changes to be honest.
Could you elaborate a bit more what’s your usecase / your need for such feature?

Super thank you for this. Here is the situation: we are using our xwiki for our system documentation and we provide our clients with access to this. I noticed something missing from our release notes (software company) from last year and added it in - there were questions as to what this update was. It was a very small addition that was fully documented in our documentation. So summary: main purpose is to avoid ‘churn’ on topics/pages that we might want to update that we have deemed ‘unimportant’.

This sounds like a good possibility - just no idea how to go about doing that. When you say notification settings sheet - this is something that can only be updated in a more ‘code-like’ manner? I’ve really only explored the admin tools and would need some examples to look at - might you have anything you can point me to?

Still trying to understand properly your usecase: as far as I understand, the page is not important anymore in your case no?
Because there’s two possibilities:

  1. you implement something to prevent users to watch some pages: this won’t impact existing watchers, but no one could ever watch the page
  2. you implement something to remove the filter that makes a page watched for some users: this impact only existing watchers, anyone is still able to watch a page afterwards

I have the feeling that solution 2 would be a better solution, first it’s easier to do, and second it allows you a better scope in time and space: you know that at that moment and for those users you want to remove the watch filter.

Note that a very close ticket already exists: [XWIKI-17523] Global Notification Filters - XWiki.org JIRA

Likely correct - 2 seems easier. Still no idea how to implement this though

super and thank you @surli

Still no idea how to implement this though

To be tested, but the easiest way would be an algorithm like this:

  • given a reference of a page you want your users to “unwatch”
  • iterate over all users
  • call this API with an exclusive filter type and an empty list of event types (if I’m correct, empty there means all events)

you should be able to write such script using only velocity, I advise you to check this documentation first: Scripting (XWiki.org)