@WithMockUser(username = USERNAME) @Test void delete() { String entityTypeId = "entityTypeId"; when(userPermissionEvaluator.hasPermission( new EntityTypeIdentity(entityTypeId), EntityTypePermission.DELETE_METADATA)) .thenReturn(true); EntityType entityType = mock(EntityType.class); when(entityType.getId()).thenReturn("entityTypeId").getMock(); repo.delete(entityType); verify(mutableAclService).deleteAcl(new EntityTypeIdentity(entityTypeId), true); verify(mutableAclClassService).deleteAclClass("entity-" + entityTypeId); verify(delegateRepository).delete(entityType); }
@Override public void deleteAcl(EntityType entityType) { mutableAclService.deleteAcl(new EntityTypeIdentity(entityType), true); mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)); }
EntityTypeRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<EntityType> { @Override public void deleteAcl(EntityType entityType) { mutableAclService.deleteAcl(new EntityTypeIdentity(entityType), true); mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)); } }
EntityTypeRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<EntityType> { @Override public void deleteAcl(EntityType entityType) { mutableAclService.deleteAcl(new EntityTypeIdentity(entityType), true); mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)); } EntityTypeRepositorySecurityDecorator(
      Repository<EntityType> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      DataService dataService); }
EntityTypeRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<EntityType> { @Override public void deleteAcl(EntityType entityType) { mutableAclService.deleteAcl(new EntityTypeIdentity(entityType), true); mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)); } EntityTypeRepositorySecurityDecorator(
      Repository<EntityType> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      DataService dataService); @Override boolean isActionPermitted(EntityType entityType, Action action); @Override boolean isActionPermitted(Object id, Action action); @Override void createAcl(EntityType entityType); @Override void deleteAcl(EntityType entityType); @Override void deleteAcl(Object entityTypeId); @Override void updateAcl(EntityType entityType); @Override void throwPermissionException(EntityType entityType, Action action); }
EntityTypeRepositorySecurityDecorator extends AbstractRowLevelSecurityRepositoryDecorator<EntityType> { @Override public void deleteAcl(EntityType entityType) { mutableAclService.deleteAcl(new EntityTypeIdentity(entityType), true); mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)); } EntityTypeRepositorySecurityDecorator(
      Repository<EntityType> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      DataService dataService); @Override boolean isActionPermitted(EntityType entityType, Action action); @Override boolean isActionPermitted(Object id, Action action); @Override void createAcl(EntityType entityType); @Override void deleteAcl(EntityType entityType); @Override void deleteAcl(Object entityTypeId); @Override void updateAcl(EntityType entityType); @Override void throwPermissionException(EntityType entityType, Action action);  }