Allow managers to CRUD all account types (not just admins)
Per the assignment's instructions.
This commit is contained in:
parent
803db7a5b2
commit
81c3db20d4
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ server config@T.Config{..} = createAccount
|
||||||
(Nothing, T.Admin) ->
|
(Nothing, T.Admin) ->
|
||||||
throwError err401 { errBody = "Only admins can create Admin accounts" }
|
throwError err401 { errBody = "Only admins can create Admin accounts" }
|
||||||
(Just cookie, _) ->
|
(Just cookie, _) ->
|
||||||
adminsOnly cookie doCreateAccount
|
adminsAnd cookie (\T.Account{..} -> accountRole == T.Manager) doCreateAccount
|
||||||
where
|
where
|
||||||
doCreateAccount :: Handler NoContent
|
doCreateAccount :: Handler NoContent
|
||||||
doCreateAccount = do
|
doCreateAccount = do
|
||||||
|
|
Loading…
Reference in a new issue