HttpServletRequest request) {
if (!PermissionUtils.isAuthorized(Permission.CAN_MANAGE_TEAMS, orgId, null)) {
return "403";
}
Organization organization = organizationService.loadById(orgId);
if (organization == null || !organization.isActive()) {
log.warn(ResourceNotFoundException.getLogMessage("Organization", orgId));
throw new ResourceNotFoundException();
} else {
String teamName = organization.getName();
organizationService.markInactive(organization);
log.info("Organization soft deletion was successful on Organization " + organization.getName() + ".");
ControllerUtils.addSuccessMessage(request,
"Team " + teamName + " has been deleted successfully.");
return "redirect:/";
}
}