20after4 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182974

Change subject: force the security policy on the transition to 'security-bug' 
from any other value.
......................................................................

force the security policy on the transition to 'security-bug' from any other 
value.

Change-Id: I29cc643fd1a13e76e7fc86f79b39e5a87ac14a28
---
M src/policy/SecurityPolicyListener.php
1 file changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/security 
refs/changes/74/182974/1

diff --git a/src/policy/SecurityPolicyListener.php 
b/src/policy/SecurityPolicyListener.php
index b13dd12..7dcffc2 100644
--- a/src/policy/SecurityPolicyListener.php
+++ b/src/policy/SecurityPolicyListener.php
@@ -41,9 +41,21 @@
     if (!$is_new) {
       // on pre-existing tasks we simply
       // filter out any transactions that would make the task public
-      $event->setValue('transactions',
-        WMFSecurityPolicy::filter_policy_transactions($transactions));
-      return;
+      $transactions =
+        WMFSecurityPolicy::filter_policy_transactions($transactions);
+      $event->setValue('transactions', $transactions);
+
+      $switchToSecurity = false;
+
+      foreach ($transactions as $t) {
+        if ($t->getNewValue() == 'security-bug'
+          && $t->getOldValue() != 'security-bug') {
+          $switchToSecurity = true;
+        }
+      }
+      if (!$switchToSecurity) {
+        return;
+      }
     }
 
     if ($security_setting == 'ops-access-request') {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29cc643fd1a13e76e7fc86f79b39e5a87ac14a28
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions/security
Gerrit-Branch: master
Gerrit-Owner: 20after4 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to