Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 718-725 (lines=8) @@
715
	 *
716
	 * @return bool|WP_Error True if user is able to disconnect the site.
717
	 */
718
	public static function connect_url_permission_callback() {
719
		if ( current_user_can( 'jetpack_connect_user' ) ) {
720
			return true;
721
		}
722
723
		return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
724
725
	}
726
727
	/**
728
	 * Verify that a user can get the data about the current user.
@@ 737-743 (lines=7) @@
734
	 *
735
	 * @return bool|WP_Error True if user is able to unlink.
736
	 */
737
	public static function get_user_connection_data_permission_callback() {
738
		if ( current_user_can( 'jetpack_connect_user' ) ) {
739
			return true;
740
		}
741
742
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
743
	}
744
745
	/**
746
	 * Check that user has permission to change the master user.