diff --git a/src/main/java/com/pedro/sphynx/domain/AccessService.java b/src/main/java/com/pedro/sphynx/domain/AccessService.java index 2975193..71ca985 100644 --- a/src/main/java/com/pedro/sphynx/domain/AccessService.java +++ b/src/main/java/com/pedro/sphynx/domain/AccessService.java @@ -61,6 +61,10 @@ public AccessDataComplete validateCreation(AccessDataInput data, String language LocalDataComplete local = new LocalDataComplete(localRepository.findByMac(data.local())); if(local.permission() > consumer.permission()){ + var access = new Access(null, consumerRepository.findByTag(data.tag()), localRepository.findByName(data.local()), false, LocalDateTime.now()); + + accessRepository.save(access); + throw new Validation(messages.getString("error.consumerDontHavePermission")); }