@PUT
    @Path("{id}")
    @ApiOperation("Update view")
    @AuditEvent(type = ViewsAuditEventTypes.VIEW_UPDATE)
    public ViewDTO update(@ApiParam(name = "id") @PathParam("id") @NotEmpty String id,
                          @ApiParam @Valid ViewDTO dto,
                          @Context SearchUser searchUser) {
        final ViewDTO updatedDTO = dto.toBuilder().id(id).build();
        if (!searchUser.canUpdateView(updatedDTO)) {
            throw new ForbiddenException("Not allowed to edit " + summarize(updatedDTO) + ".");
        }

        validateIntegrity(updatedDTO, searchUser, false);

        var result = dbService.update(updatedDTO);
        recentActivityService.update(result.id(), result.type().equals(ViewDTO.Type.DASHBOARD) ? GRNTypes.DASHBOARD : GRNTypes.SEARCH, searchUser);
        return result;
    }
@Test
    public void throwsExceptionWhenUpdatingDashboardWithFilterThatUserIsNotAllowedToSee() {
        final ViewsResource viewsResource = createViewsResource(
                mockViewService(TEST_DASHBOARD_VIEW),
                mock(StartPageService.class),
                mock(RecentActivityService.class),
                mock(ClusterEventBus.class),
                new ReferencedSearchFiltersHelper(),
                searchFilterVisibilityChecker(Collections.singletonList("<<You cannot see this filter>>")),
                EMPTY_VIEW_RESOLVERS,
                SEARCH
        );

        Assertions.assertThatThrownBy(() -> viewsResource.update(VIEW_ID, TEST_DASHBOARD_VIEW, SEARCH_USER))
                .isInstanceOf(BadRequestException.class)
                .hasMessageContaining("View cannot be saved, as it contains Search Filters which you are not privileged to view : [<<You cannot see this filter>>]");
    }