Search code examples
mediawikiusability

Disable rollback-with-one-click function


For maintaining a vibrant wiki with a large user base that allows for anonymous edits, there is a great value in having a function to easily revert malicious mass edits (i.e. vandalism and spam) with little effort.


*"Rollback" reverts the last contributor's edit(s) to this page in one click*
"Rollback" reverts the last contributor's edit(s) to this page in one click


On the other hand, if your wiki is in log-in-to-edit mode and has only few members who collect their community knowledge in a very collaborative manner (for example a company wiki), you'll probably decide to balance work and permissions/restrictions by granting admin rights even to members that aren't MediaWiki "native speakers". In this case the rollback function could be dangerous: Accidentally pressing the wrong button could easily cause confusion.

How can I disable the rollback function?


Solution

  • One possible way is to make the dangerous element invisible by suppressing its visual representation via CSS.

    span.mw-rollback-link {
       display: none;
    }
    

    This addition can be made to MediaWiki:Group-sysop.css to affect (skin-independently) all members of the sysop group (since, as you already know, only users in that group have this function).

    A more robust solution

    In case your wiki has additional groups, the restriction to the sysop group can be dangerous, if one of these groups includes the rollback permission. Therefore the most robust way to remove the rollback function from the interface is applying above addition to MediaWiki:Common.css.

    Emergency switch

    As to temporarily reactivate the rollback function, say during a spam or vandalism attack, it's enough to deliberately introduce an obvious syntactic CSS error

    x-span.mw-rollback-link {
       display: none;
    }
    

    and to “repair” it afterwards.

    Conclusion

    Of course it's possible to remove that permission from the entire wiki via server-side configuration, i.e. modify LocalSettings.php as shown in Tgr's answer. But in case the wiki is openly accessible, it may be hard to react fast enough to actual needs, so I feel better with the CSS approach.