InsufficientRights

This commit is contained in:
Philippe Pittoli 2024-02-24 20:37:46 +01:00
parent b448278c84
commit 0793b2c878
2 changed files with 9 additions and 0 deletions

View File

@ -599,6 +599,8 @@ handleAction = case _ of
handleAction $ Log $ ErrorLog $ "MkUnknownUser"
(DNSManager.MkNoOwnership _) -> do
handleAction $ Log $ ErrorLog $ "MkNoOwnership"
(DNSManager.MkInsufficientRights _) -> do
handleAction $ Log $ ErrorLog $ "You do not have sufficient rights."
-- The authentication failed.
(DNSManager.MkError errmsg) -> do
handleAction $ Log $ ErrorLog $ "reason is: " <> errmsg.reason

View File

@ -225,6 +225,11 @@ type NoOwnership = { }
codecNoOwnership ∷ CA.JsonCodec NoOwnership
codecNoOwnership = CA.object "NoOwnership" (CAR.record { })
{- 52 -}
type InsufficientRights = { }
codecInsufficientRights ∷ CA.JsonCodec InsufficientRights
codecInsufficientRights = CA.object "InsufficientRights" (CAR.record { })
{- 250 -}
--type KeepAlive = { }
--codecKeepAlive ∷ CA.JsonCodec KeepAlive
@ -272,6 +277,7 @@ data AnswerMessage
| MkRRReadOnly RRReadOnly -- 22
| MkUnknownUser UnknownUser -- 50
| MkNoOwnership NoOwnership -- 51
| MkInsufficientRights InsufficientRights -- 52
| GotKeepAlive KeepAlive -- 250
encode ∷ RequestMessage -> Tuple UInt String
@ -324,6 +330,7 @@ decode number string
22 -> error_management codecRRReadOnly MkRRReadOnly
50 -> error_management codecUnknownUser MkUnknownUser
51 -> error_management codecNoOwnership MkNoOwnership
52 -> error_management codecInsufficientRights MkInsufficientRights
250 -> error_management codecKeepAlive GotKeepAlive
_ -> Left UnknownNumber
where