public String deleteUserConfirm()

in app/src/main/java/com/amazon/aws/partners/saasfactory/pgrls/controller/TenantController.java [194:216]


    public String deleteUserConfirm(Authentication authentication, @RequestParam("id") String id, Model model, final RedirectAttributes redirectAttributes) {
        String view = null;
        UUID userId = UUID.fromString(id);
        User user = tenantService.getUser(userId);
        if (user == null) {
            user = new User();
            if (adminService.userExists(userId)) {
                LOGGER.warn("Authenticated tenant is not authorized to save user for current tenant");
                Tenant authenticatedTenant = (Tenant) authentication.getPrincipal();
                redirectAttributes.addFlashAttribute("css", "danger");
                redirectAttributes.addFlashAttribute("msg", "Row Level Security policies prevented " + authenticatedTenant.getIdAsString() + " from deleting user " + id);
                view = "redirect:/tenant";
            } else {
                model.addAttribute("css", "danger");
                model.addAttribute("msg", "No user for id " + id);
                view = "deleteUser";
            }
        } else {
            view = "deleteUser";
        }
        model.addAttribute("user", user);
        return view;
    }