diff options
author | Mike Crute <mike@crute.us> | 2021-11-22 18:40:10 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2021-11-22 18:40:10 -0800 |
commit | 22819ad3543b6bad4f6efcedbebb8437292cae3b (patch) | |
tree | 18aa26d5af1418fe6b36e4be24c24532f8873490 | |
parent | 8bb307c11b51cb0fda3df374bdc9c0958b7d522e (diff) | |
download | cloud-identity-broker-22819ad3543b6bad4f6efcedbebb8437292cae3b.tar.bz2 cloud-identity-broker-22819ad3543b6bad4f6efcedbebb8437292cae3b.tar.xz cloud-identity-broker-22819ad3543b6bad4f6efcedbebb8437292cae3b.zip |
Disallow deleting account with PUT
-rw-r--r-- | app/controllers/api_account.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/api_account.go b/app/controllers/api_account.go index 259a7d4..8ef18ce 100644 --- a/app/controllers/api_account.go +++ b/app/controllers/api_account.go | |||
@@ -125,6 +125,13 @@ func (h *APIAccountHandler) HandlePut(c echo.Context) error { | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | if in.Deleted != nil && a.Deleted == nil { | ||
129 | return &echo.HTTPError{ | ||
130 | Code: http.StatusBadRequest, | ||
131 | Message: "Use the DELETE method to delete a record", | ||
132 | } | ||
133 | } | ||
134 | |||
128 | a.AccountNumber = in.AccountNumber | 135 | a.AccountNumber = in.AccountNumber |
129 | a.Name = in.Name | 136 | a.Name = in.Name |
130 | a.ConsoleSessionDuration = in.ConsoleSessionDuration | 137 | a.ConsoleSessionDuration = in.ConsoleSessionDuration |