- $errors = $titleObj->getUserPermissionsErrors( 'protect', $this->getUser() );
- if ( $errors ) {
- // We don't care about multiple errors, just report one of them
- $this->dieUsageMsg( reset( $errors ) );
+ $this->checkTitleUserPermissions( $titleObj, 'protect' );
+
+ $user = $this->getUser();
+ $tags = $params['tags'];
+
+ // Check if user can add tags
+ if ( !is_null( $tags ) ) {
+ $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $user );
+ if ( !$ableToTag->isOK() ) {
+ $this->dieStatus( $ableToTag );
+ }