コード例 #1
0
 @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);
 }
コード例 #2
0
  @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);
  }
コード例 #3
0
 @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);
 }
コード例 #4
0
 public List<BankingTx> getTransactions(String accountId) {
   return aclBankingTxDao.getTransactions(accountId);
 }
コード例 #5
0
 public void updateTransaction(BankingTx tx) {
   aclBankingTxDao.update(tx);
 }
コード例 #6
0
 @Secured("AFTER_ACL_COLLECTION_READ")
 public List<BankingTx> getTransactions() {
   return aclBankingTxDao.getTransactionList();
 }
コード例 #7
0
 @Secured("AFTER_ACL_READ")
 public BankingTx findByTransactionID(String txId) {
   return aclBankingTxDao.findByTransactionID(txId);
 }