Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 878-885 (lines=8) @@
875
	 *
876
	 * @return bool|WP_Error True if user is able to disconnect the site.
877
	 */
878
	public static function connect_url_permission_callback() {
879
		if ( current_user_can( 'jetpack_connect_user' ) ) {
880
			return true;
881
		}
882
883
		return new WP_Error( 'invalid_user_permission_jetpack_connect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
884
885
	}
886
887
	/**
888
	 * Verify that a user can get the data about the current user.
@@ 897-903 (lines=7) @@
894
	 *
895
	 * @return bool|WP_Error True if user is able to unlink.
896
	 */
897
	public static function get_user_connection_data_permission_callback() {
898
		if ( current_user_can( 'jetpack_connect_user' ) ) {
899
			return true;
900
		}
901
902
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
903
	}
904
905
	/**
906
	 * Check that user has permission to change the master user.