@Test void testDelete() { Package package1 = mock(Package.class); Package package2 = mock(Package.class); when(package1.getId()).thenReturn("1"); when(package2.getId()).thenReturn("2"); when(package1.getParent()).thenReturn(package2); doReturn(true).when(userPermissionEvaluator).hasPermission(new PackageIdentity("2"), UPDATE); repo.delete(package1); verify(mutableAclService).deleteAcl(new PackageIdentity("1"), true); verify(delegateRepository).delete(package1); }
@Override public void deleteAcl(Object id) { PackageIdentity packageIdentity = new PackageIdentity(id.toString()); mutableAclService.deleteAcl(packageIdentity, true); }
PackageRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Package> { @Override public void deleteAcl(Object id) { PackageIdentity packageIdentity = new PackageIdentity(id.toString()); mutableAclService.deleteAcl(packageIdentity, true); } }
PackageRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Package> { @Override public void deleteAcl(Object id) { PackageIdentity packageIdentity = new PackageIdentity(id.toString()); mutableAclService.deleteAcl(packageIdentity, true); } PackageRepositorySecurityDecorator(
      Repository<Package> delegateRepository,
      MutableAclService mutableAclService,
      UserPermissionEvaluator userPermissionEvaluator); }
PackageRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Package> { @Override public void deleteAcl(Object id) { PackageIdentity packageIdentity = new PackageIdentity(id.toString()); mutableAclService.deleteAcl(packageIdentity, true); } PackageRepositorySecurityDecorator(
      Repository<Package> delegateRepository,
      MutableAclService mutableAclService,
      UserPermissionEvaluator userPermissionEvaluator); @Override boolean isActionPermitted(Package updatedPack, Action action); @Override boolean isActionPermitted(Object id, Action action); @Override void throwPermissionException(Package pack, Action action); @Override Package findOneById(Object id); @Override void add(Package pack); @Override void update(Package pack); @Override Integer add(Stream<Package> packages); @Override void createAcl(Package pack); @Override void deleteAcl(Object id); @Override void deleteAcl(Package pack); @Override void updateAcl(Package pack); }
PackageRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Package> { @Override public void deleteAcl(Object id) { PackageIdentity packageIdentity = new PackageIdentity(id.toString()); mutableAclService.deleteAcl(packageIdentity, true); } PackageRepositorySecurityDecorator(
      Repository<Package> delegateRepository,
      MutableAclService mutableAclService,
      UserPermissionEvaluator userPermissionEvaluator); @Override boolean isActionPermitted(Package updatedPack, Action action); @Override boolean isActionPermitted(Object id, Action action); @Override void throwPermissionException(Package pack, Action action); @Override Package findOneById(Object id); @Override void add(Package pack); @Override void update(Package pack); @Override Integer add(Stream<Package> packages); @Override void createAcl(Package pack); @Override void deleteAcl(Object id); @Override void deleteAcl(Package pack); @Override void updateAcl(Package pack);  }