This commit is contained in:
Andrea Condoluci 2020-04-03 09:46:07 +02:00
parent 55ca81a474
commit 1dc12beef3

View file

@ -198,7 +198,7 @@ allUsers = map (exclude ["_id"]) `liftM` (rest =<< find
addUser :: (MonadIO m)
=> Bool -> Username -> Password -> Action m ()
-- ^ Add user with password with read-only access if the boolean argument is @True@, or read-write access if its is @False@
-- ^ Add user with password with read-only access if the boolean argument is @True@, or read-write access if it's @False@
addUser readOnly user pass = do
mu <- findOne (select ["user" =: user] "system.users")
let usr = merge ["readOnly" =: readOnly, "pwd" =: pwHash user pass] (maybe ["user" =: user] id mu)