Change arguments of connector function views to take a more reasonable parameter of a BankAccount instead of just an id

This commit is contained in:
Everett Sochowski 2014-03-06 14:09:54 +01:00
parent d93accc7a2
commit 7e7e854608
2 changed files with 4 additions and 4 deletions

View File

@ -277,7 +277,7 @@ class BankAccount(
//check if the user have access to the owner view in this the account
if(user.ownerAccess(this))
for{
isRevoked <- LocalStorage.views(id) ?~ "could not get the views"
isRevoked <- LocalStorage.views(this) ?~ "could not get the views"
} yield isRevoked
else
Failure("user : " + user.emailAddress + " don't have access to owner view on account " + id, Empty, Empty)

View File

@ -85,7 +85,7 @@ trait LocalStorage extends Loggable {
def createView(bankAccount : BankAccount, view: ViewCreationJSON) : Box[View]
def removeView(viewId: String, bankAccount: BankAccount): Box[Unit]
def views(bankAccountID : String) : Box[List[View]]
def views(bankAccount : BankAccount) : Box[List[View]]
def permittedViews(user: User, bankAccount: BankAccount): List[View]
def publicViews(bankAccount : BankAccount) : Box[List[View]]
@ -788,8 +788,8 @@ class MongoDBLocalStorage extends LocalStorage {
} yield {}
}
def views(bankAccountID : String) : Box[List[View]] = {
for(account <- HostedAccount.find(By(HostedAccount.accountID,bankAccountID)))
def views(bankAccount : BankAccount) : Box[List[View]] = {
for(account <- HostedAccount.find(By(HostedAccount.accountID, bankAccount.id)))
yield {
account.views.toList
}