Skip to content

Commit

Permalink
feat: saving the access error in database
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroVidalDev committed Apr 22, 2024
1 parent 0aa1505 commit 7571810
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/pedro/sphynx/domain/AccessService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down

0 comments on commit 7571810

Please sign in to comment.