SEC-1650: Updates and corrections to tutorial sample to fit better with new tutorial.

This commit is contained in:
Luke Taylor
2011-05-03 22:23:55 +01:00
parent 685f12c5a0
commit 80fd96df6d
5 changed files with 15 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ public interface BankService {
public Account[] findAccounts();
@PreAuthorize(
"hasRole('ROLE_SUPERVISOR') or " +
"hasRole('ROLE_TELLER') and (#account.balance + #amount >= -#account.overdraft)" )
"hasRole('supervisor') or " +
"hasRole('teller') and (#account.balance + #amount >= -#account.overdraft)" )
public Account post(Account account, double amount);
}

View File

@@ -17,9 +17,9 @@ public class BankServiceImpl implements BankService {
public Account post(Account account, double amount) {
Assert.notNull(account);
// We read account bank from DAO so it reflects the latest balance
// We read account back from DAO so it reflects the latest balance
Account a = bankDao.readAccount(account.getId());
if (account == null) {
if (a == null) {
throw new IllegalArgumentException("Couldn't find requested account");
}