Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 1042-1049 (lines=8) @@
1039
	 *
1040
	 * @return bool|WP_Error True if user is able to disconnect the site.
1041
	 */
1042
	public static function connect_url_permission_callback() {
1043
		if ( current_user_can( 'jetpack_connect_user' ) ) {
1044
			return true;
1045
		}
1046
1047
		return new WP_Error( 'invalid_user_permission_jetpack_connect', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
1048
1049
	}
1050
1051
	/**
1052
	 * Verify that a user can get the data about the current user.
@@ 1061-1067 (lines=7) @@
1058
	 *
1059
	 * @return bool|WP_Error True if user is able to unlink.
1060
	 */
1061
	public static function get_user_connection_data_permission_callback() {
1062
		if ( current_user_can( 'jetpack_connect_user' ) ) {
1063
			return true;
1064
		}
1065
1066
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
1067
	}
1068
1069
	/**
1070
	 * Check that user has permission to change the master user.