+ return Status::newGood();
+ }
+
+ /**
+ * Is it OK to allow the user to create this tag?
+ *
+ * @param string $tag Tag that you are interested in creating
+ * @param User|null $user User whose permission you wish to check, or null if
+ * you don't care (e.g. maintenance scripts)
+ * @return Status
+ * @since 1.25
+ */
+ public static function canCreateTag( $tag, User $user = null ) {
+ if ( !is_null( $user ) ) {
+ if ( !$user->isAllowed( 'managechangetags' ) ) {
+ return Status::newFatal( 'tags-manage-no-permission' );
+ } elseif ( $user->isBlocked() ) {
+ return Status::newFatal( 'tags-manage-blocked', $user->getName() );
+ }
+ }
+
+ $status = self::isTagNameValid( $tag );
+ if ( !$status->isGood() ) {
+ return $status;
+ }
+