jenkins-bot has submitted this change and it was merged.

Change subject: Add protected & semiprotected notices to api.
......................................................................


Add protected & semiprotected notices to api.

Bug: 50415
Change-Id: I2966a31b909e44aa371dfe84cb68c264420e35a7
---
M ApiVisualEditor.php
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index 85d1ed8..ea37c9a 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -265,6 +265,16 @@
                                if ( $parsed && $parsed['restoring'] ) {
                                        $wgVisualEditorEditNotices[] = 
'editingold';
                                }
+                               // Protected page
+                               if ( $page->getNamespace() != NS_MEDIAWIKI && 
$page->isProtected( 'edit' ) ) {
+                                       # Is the title semi-protected?
+                                       if ( $page->isSemiProtected() ) {
+                                               $wgVisualEditorEditNotices[] = 
'semiprotectedpagewarning';
+                                       } else {
+                                               # Then it must be protected 
based on static groups (regular)
+                                               $wgVisualEditorEditNotices[] = 
'protectedpagewarning';
+                                       }
+                               }
                                if ( count( $wgVisualEditorEditNotices ) ) {
                                        foreach ( $wgVisualEditorEditNotices as 
$key ) {
                                                $notices[] = wfMessage( $key 
)->parseAsBlock();

-- 
To view, visit https://gerrit.wikimedia.org/r/73022
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2966a31b909e44aa371dfe84cb68c264420e35a7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Robmoen <rm...@wikimedia.org>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to