@PreAuthorize("isAuthenticated() and (hasRole('ROLE_USER'))") @HandleBeforeDelete public void beforeTransactionDelete(Transaction transaction) { logger.debug( String.format( "In before delete for a transaction with a category of '%s' and a payee of '%s'", transaction.getCategory(), transaction.getPayee())); // Don't need to add anything to this method, the @PreAuthorize does the job. }
@PreAuthorize("isAuthenticated() and (hasRole('ROLE_USER'))") @HandleBeforeSave public void beforeTransactionUpdate(Transaction transaction) { logger.debug( String.format( "In before update for a transaction with a category of '%s' and a payee of '%s'", transaction.getCategory(), transaction.getPayee())); transaction.setUpdatedDate(Calendar.getInstance().getTime()); }