Code Duplication    Length = 7-8 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 541-548 (lines=8) @@
538
	 *
539
	 * @return bool|WP_Error True if user is able to disconnect the site.
540
	 */
541
	public static function connect_url_permission_callback() {
542
		if ( current_user_can( 'jetpack_connect_user' ) ) {
543
			return true;
544
		}
545
546
		return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
547
548
	}
549
550
	/**
551
	 * Verify that a user can get the data about the current user.
@@ 560-566 (lines=7) @@
557
	 *
558
	 * @return bool|WP_Error True if user is able to unlink.
559
	 */
560
	public static function get_user_connection_data_permission_callback() {
561
		if ( current_user_can( 'jetpack_connect_user' ) ) {
562
			return true;
563
		}
564
565
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
566
	}
567
568
	/**
569
	 * Check that user has permission to change the master user.