Unicornisaurous has uploaded a new change for review.

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

Change subject: Prevent blocked users from changing tags
......................................................................

Prevent blocked users from changing tags

Bug: T102063
Change-Id: I030b781175c998dd1553c87042d98ded8eb6bc84
---
M includes/changetags/ChangeTags.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/259442/1

diff --git a/includes/changetags/ChangeTags.php 
b/includes/changetags/ChangeTags.php
index bbb5c8c..df2b28a 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -358,7 +358,7 @@
        public static function canAddTagsAccompanyingChange( array $tags,
                User $user = null ) {
 
-               if ( !is_null( $user ) && !$user->isAllowed( 'applychangetags' 
) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 
'applychangetags' ) || $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-apply-no-permission' );
                }
 
@@ -425,7 +425,7 @@
        public static function canUpdateTags( array $tagsToAdd, array 
$tagsToRemove,
                User $user = null ) {
 
-               if ( !is_null( $user ) && !$user->isAllowed( 'changetags' ) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 'changetags' ) 
|| $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-update-no-permission' );
                }
 
@@ -766,7 +766,7 @@
         * @since 1.25
         */
        public static function canActivateTag( $tag, User $user = null ) {
-               if ( !is_null( $user ) && !$user->isAllowed( 'managechangetags' 
) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 
'managechangetags' ) || $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-manage-no-permission' );
                }
 
@@ -830,7 +830,7 @@
         * @since 1.25
         */
        public static function canDeactivateTag( $tag, User $user = null ) {
-               if ( !is_null( $user ) && !$user->isAllowed( 'managechangetags' 
) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 
'managechangetags' ) || $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-manage-no-permission' );
                }
 
@@ -885,7 +885,7 @@
         * @since 1.25
         */
        public static function canCreateTag( $tag, User $user = null ) {
-               if ( !is_null( $user ) && !$user->isAllowed( 'managechangetags' 
) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 
'managechangetags' ) || $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-manage-no-permission' );
                }
 
@@ -1014,7 +1014,7 @@
        public static function canDeleteTag( $tag, User $user = null ) {
                $tagUsage = self::tagUsageStatistics();
 
-               if ( !is_null( $user ) && !$user->isAllowed( 'managechangetags' 
) ) {
+               if ( !is_null( $user ) && ( !$user->isAllowed( 
'managechangetags' ) || $user->isBlocked() ) ) {
                        return Status::newFatal( 'tags-manage-no-permission' );
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I030b781175c998dd1553c87042d98ded8eb6bc84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Unicornisaurous <[email protected]>

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

Reply via email to