From 275002e25d9771fd25230d4bd4186867d21879ae Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Mon, 12 Oct 2015 16:37:02 -0400 Subject: [PATCH] Adds dbrole filter back to root path querying the database --- src/PostgREST/App.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PostgREST/App.hs b/src/PostgREST/App.hs index 680fe62a3..77fabf02b 100644 --- a/src/PostgREST/App.hs +++ b/src/PostgREST/App.hs @@ -62,7 +62,8 @@ app dbstructure conf reqBody req = case (path, verb) of ([], _) -> do - let body = encode $ filter ((cs schema==).tableSchema) allTabs + Identity (dbrole :: Text) <- H.singleEx $ [H.stmt|SELECT current_user|] + let body = encode $ filter (filterTableAcl dbrole) $ filter ((cs schema==).tableSchema) allTabs return $ responseLBS status200 [jsonH] $ cs body ([table], "OPTIONS") -> do