Wikimedia Developer Support

MediaWiki Javascript Config to get Restriction type



On, There is two mw.config for check page protection level, First one is wgIsProbablyEditable, which true or false. The Second one is wgRestrictionEdit, which return the array of the group. which can edit the page. But I want to also know which kind of protection level is. If a page is protected due to Cascading protection. So How can I take this in javascript?

Also:- is not giving Restriction cause. Thanks in advance :slight_smile:


Apparently, there’s no way to tell from JavaScript variables if a page is affected by cascading protection, This makes sense, because that’s probably expensive and that’s why the wgIsProbablyEditable is in place.

Protection reason is not exposed from the api. Since the normal interface exposes it in Special:ProtectedPages, I guess it would be sensible to expose it also from the api


Thanks :slight_smile: