mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
server: fix the FromJSON instance of FunctionPermissionsCtx
GitOrigin-RevId: 506d654ef9cad95ffdddbf832a2779fc34e6bd00
This commit is contained in:
parent
64d776c9de
commit
05f21a2768
@ -183,11 +183,8 @@ data FunctionPermissionsCtx
|
||||
deriving (Show, Eq)
|
||||
|
||||
instance FromJSON FunctionPermissionsCtx where
|
||||
parseJSON = withText "FunctionPermissionsCtx" $ \t ->
|
||||
case T.toLower t of
|
||||
"true" -> pure FunctionPermissionsInferred
|
||||
"false" -> pure FunctionPermissionsManual
|
||||
_ -> fail "infer_function_permissions should be a boolean value"
|
||||
parseJSON = withBool "FunctionPermissionsCtx" $
|
||||
pure . bool FunctionPermissionsManual FunctionPermissionsInferred
|
||||
|
||||
instance ToJSON FunctionPermissionsCtx where
|
||||
toJSON = \case
|
||||
|
Loading…
Reference in New Issue
Block a user