Allow managers to CRUD all account types (not just admins)

Per the assignment's instructions.
This commit is contained in:
William Carroll 2020-08-02 14:31:00 +01:00
parent 803db7a5b2
commit 81c3db20d4

View file

@ -89,7 +89,7 @@ server config@T.Config{..} = createAccount
(Nothing, T.Admin) ->
throwError err401 { errBody = "Only admins can create Admin accounts" }
(Just cookie, _) ->
adminsOnly cookie doCreateAccount
adminsAnd cookie (\T.Account{..} -> accountRole == T.Manager) doCreateAccount
where
doCreateAccount :: Handler NoContent
doCreateAccount = do