instead of select * inspect schema to get selectable columns

This commit is contained in:
2026-08-16 14:41:13 +02:00
parent 4a5d626112
commit ce7ea53a57
7 changed files with 132 additions and 48 deletions
+5 -2
View File
@@ -120,9 +120,12 @@ spec withConfig = withConfig baseCfg $
}
context "table with limited privileges" $ do
it "fails deleting the row when return=representation and selecting all the columns" $
it "succeeds deleting the row when return=representation and selecting all columns, returning only the privileged columns" $
request methodDelete "/app_users?id=eq.1" [("Prefer", "return=representation")] mempty
`shouldRespondWith` 401
`shouldRespondWith` [json|[ { "id": 1, "email": "test@123.com" } ]|]
{ matchStatus = 200
, matchHeaders = ["Content-Range" <:> "*/*"]
}
it "succeeds deleting the row when return=representation and selecting only the privileged columns" $
request methodDelete "/app_users?id=eq.1&select=id,email" [("Prefer", "return=representation")]