Commit 744d298e authored by Matija Obreza's avatar Matija Obreza
Browse files

AclAssignerAspect should work on superclass repository.*.save and delete methods

parent 3541f7ae
......@@ -33,7 +33,7 @@ public class AclAssignerAspect {
* @param result
* @return
*/
@AfterReturning(pointcut = "execution(* org.croptrust.projectmanager.persistence.*.save(..))", returning = "result")
@AfterReturning(pointcut = "execution(* org.springframework.data.repository.*.save(..))", returning = "result")
public Object afterSaveAclObject(Object result) {
boolean needsAcl = false;
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
......@@ -64,14 +64,14 @@ public class AclAssignerAspect {
*
* @param joinPoint
*/
@After("execution(* org.croptrust.projectmanager.persistence.*.delete(..))")
@After("execution(* org.springframework.data.repository.*.delete(..))")
public void afterDeleteAclObject(JoinPoint joinPoint) {
final Object arg0 = joinPoint.getArgs()[0];
try {
if (arg0 instanceof AclAwareModel) {
final AclAwareModel aclModel = (AclAwareModel) arg0;
LOG.trace("Inserting ACL entries for model={}", aclModel);
LOG.trace("Removing ACL entries for model={}", aclModel);
aclService.removePermissions(aclModel);
}
} finally {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment