Commit 5968ddc5 authored by Peter Harpending's avatar Peter Harpending

Show maybeAuthId at the top of /u/#Int/balance

parent cb4e962a
......@@ -7,17 +7,18 @@ import MechBridge
import Model.User
import View.User
import qualified Data.Text as T
-- check permissions for user balance view
getUserBalanceR :: UserId -> Handler Html
getUserBalanceR user_id = do
viewer_id <- requireAuthId
if viewer_id /= user_id
then permissionDenied "You must be a site administrator to view user balances."
else getUserBalanceR' user_id
getUserBalanceR' :: UserId -> Handler Html
getUserBalanceR' user_id = do
-- viewer_id <- requireAuthId
-- if viewer_id /= user_id
-- then permissionDenied "You must be a site administrator to view user balances."
-- else getUserBalanceR' user_id
maid <- maybeAuthId
user <- runYDB $ get404 user_id
alertSuccess (T.pack $ show maid)
-- TODO: restrict viewing balance to user or snowdrift admins (logged)
-- before moving to real money
......@@ -26,9 +27,7 @@ getUserBalanceR' user_id = do
-- "You can only view your own account balance history.")
dollars <- eburn $ userFunds user_id
(add_funds_form, enctype) <- generateFormPost addTestCashForm
defaultLayout $ do
snowdriftDashTitle "User Balance" $
userDisplayName (Entity user_id user)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment