Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

68 disable acl caching #69

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed CacheService
ywarnecke committed Jul 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 023c1807847fc349cdff59773cc04dc76fa9ecff
12 changes: 0 additions & 12 deletions src/main/java/de/imi/mopat/controller/AdminController.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package de.imi.mopat.controller;

import de.imi.mopat.dao.ConfigurationDao;
import de.imi.mopat.helper.controller.CacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
* AdminController controller.
@@ -21,8 +19,6 @@ public class AdminController {
@Autowired
private ConfigurationDao configurationDao;

@Autowired
private CacheService cacheService;

/**
* @param model The model, which holds the information for the view.
@@ -34,14 +30,6 @@ public class AdminController {
public String showAdmin(final Model model) {
//Get the default language of the application from the configuration
model.addAttribute("defaultLanguage", configurationDao.getDefaultLocale());
model.addAttribute("cacheTimestamp", cacheService.getTimeStamp());
return "admin/index";
}

@PostMapping(value = "/admin/clearCache")
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String clearCache() {
cacheService.evictAllCaches();
return "redirect:/admin/index";
}
}
5 changes: 0 additions & 5 deletions src/main/java/de/imi/mopat/controller/ClinicController.java
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
import de.imi.mopat.dao.user.AclEntryDao;
import de.imi.mopat.dao.user.AclObjectIdentityDao;
import de.imi.mopat.dao.user.UserDao;
import de.imi.mopat.helper.controller.CacheService;
import de.imi.mopat.helper.controller.BundleService;
import de.imi.mopat.helper.controller.ClinicService;
import de.imi.mopat.model.Bundle;
@@ -61,8 +60,6 @@ public class ClinicController {
@Autowired
private ClinicDTOValidator clinicDTOValidator;
@Autowired
private CacheService cacheService;
@Autowired
private BundleDao bundleDao;
@Autowired
private BundleDao bundleClinicDao;
@@ -415,8 +412,6 @@ public String editClinic(@RequestParam final String action,
bundleDao.merge(deletedBundle);
}
clinicDao.updateUserRights(clinic, deletedBundles, clinicDTO.getAssignedUserDTOs());
//Evict the current ACL Cache to make changes available
cacheService.evictAllCaches();

return "redirect:/clinic/list";
}
8 changes: 0 additions & 8 deletions src/main/java/de/imi/mopat/controller/UserController.java
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
import de.imi.mopat.dao.user.InvitationDao;
import de.imi.mopat.dao.user.UserDao;
import de.imi.mopat.helper.controller.ApplicationMailer;
import de.imi.mopat.helper.controller.CacheService;
import de.imi.mopat.helper.controller.Constants;
import de.imi.mopat.model.user.AclEntry;
import de.imi.mopat.model.user.Authority;
@@ -83,9 +82,6 @@ public class UserController {
private ApplicationMailer applicationMailer;
@Autowired
private ConfigurationDao configurationDao;

@Autowired
private CacheService cacheService;
@Autowired
private MoPatActiveDirectoryLdapAuthenticationProvider activeDirectoryLdapAuthenticationProvider;

@@ -477,8 +473,6 @@ public String register(@RequestParam(value = "hash", required = false) final Str
Collection<Clinic> assignedClinics = clinicDao.getClinicsFromAclObjectIdentitys(
currentInvitation.getAssignedClinics());
model.addAttribute("clinics", assignedClinics);
//Reset caches so users can directly access assigned questionnaires
cacheService.evictAllCaches();
return "mobile/user/register";
}

@@ -617,8 +611,6 @@ public String editClinicRights(
}
}
}
//Delete ACL caches to make changes directly visible
cacheService.evictAllCaches();
return "redirect:/user/list";
}

53 changes: 0 additions & 53 deletions src/main/java/de/imi/mopat/helper/controller/CacheService.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/webapp/WEB-INF/admin/index.html
Original file line number Diff line number Diff line change
@@ -59,25 +59,6 @@
</div>
<div class="modal-body">
<table>
<tr>
<td class="w-25">
[[${messages.get(#locale, 'admin.information.cache',
'Timestamp of last cache reset')}]]:
</td>
<td class="w-25">[[${cacheTimestamp}]]</td>
<td class="w-25">
<form
method="POST"
action="clearCache"
>
<button
class="btn btn-primary"
type="submit"
th:text="${messages.get(#locale, 'admin.information.cache.action', 'Clear cache')}"
></button>
</form>
</td>
</tr>
</table>
</div>
</div>