@Transactional public void reverseTransaction(String txId) { BankingTx tx = aclBankingTxDao.findByTransactionID(txId); tx.setAmount(-tx.getAmount()); tx.setDescription("Reversed: " + " amount = " + tx.getAmount() + " for " + tx.getDescription()); tx.setTransactionId(Long.parseLong((new RandomID(9)).getId())); tx.setTransDate(new Timestamp(System.currentTimeMillis())); aclBankingTxDao.insert(tx); addPermission(tx, new PrincipalSid(getCustomerUsername(tx)), BasePermission.READ); addPermission(tx, new GrantedAuthoritySid("ROLE_REP"), BasePermission.ADMINISTRATION); addPermission(tx, new GrantedAuthoritySid("ROLE_REP"), BasePermission.DELETE); }
@Transactional @Secured({"ROLE_REP", "ACL_TRANSACTION_DELETE", "ACL_TX_DELETE"}) public void deleteTransaction(String txId) { aclBankingTxDao.delete(txId); ObjectIdentity oid = new ObjectIdentityImpl(BankingTx.class, txId); mutableAclService.deleteAcl(oid, false); }
@Transactional // @Secured("ROLE_USER") public void createTransaction(BankingTx tx) { // add due to no insert trigger in sql server if (SobaConfig.getDatabaseVendor().equalsIgnoreCase("SQLServer")) { // System.out.println ("database vendor is SQL Server"); double balance = accountManager.updateAccountBalance(tx.getAmount(), tx.getAccountId()); tx.setBalance(balance); } aclBankingTxDao.insert(tx); addPermission(tx, new PrincipalSid(getCustomerUsername(tx)), BasePermission.READ); addPermission(tx, new GrantedAuthoritySid("ROLE_REP"), BasePermission.ADMINISTRATION); addPermission(tx, new GrantedAuthoritySid("ROLE_REP"), BasePermission.DELETE); }
public List<BankingTx> getTransactions(String accountId) { return aclBankingTxDao.getTransactions(accountId); }
public void updateTransaction(BankingTx tx) { aclBankingTxDao.update(tx); }
@Secured("AFTER_ACL_COLLECTION_READ") public List<BankingTx> getTransactions() { return aclBankingTxDao.getTransactionList(); }
@Secured("AFTER_ACL_READ") public BankingTx findByTransactionID(String txId) { return aclBankingTxDao.findByTransactionID(txId); }