SEC-1650: Updates and corrections to tutorial sample to fit better with new tutorial.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user