fix for one of the failing tests (acl for tables added)

This commit is contained in:
Ruslan Talpa
2015-09-22 18:17:24 +03:00
parent a7b883c922
commit 6f55e1d389
6 changed files with 64 additions and 10 deletions
+13 -2
View File
@@ -99,10 +99,21 @@ main = do
pkRes <- H.session pool $ H.tx txParam $ allprimaryKeys
let allPrimaryKeys = either (fail . show) id pkRes
runSettings appSettings $ middle $ \req respond -> do
tableAclRes <- H.session pool $ H.tx txParam $ alltablesAcl
let allTablesAcl = either (fail . show) id tableAclRes
let dbstructure = DbStructure {
tables=allTables,
columns=allColumns,
relations=allRelations,
primaryKeys=allPrimaryKeys,
tablesAcl=allTablesAcl}
runSettings appSettings $ middle $ \ req respond -> do
body <- strictRequestBody req
resOrError <- liftIO $ H.session pool $ H.tx (Just (H.ReadCommitted, Just True)) $
authenticated conf (app allTables allRelations allColumns allPrimaryKeys conf body) req
authenticated conf (app dbstructure conf body) req
either (respond . errResponse) respond resOrError
where