This commit is contained in:
nek0 2020-10-01 19:11:52 +02:00
parent 998474640c
commit cad5239b87
2 changed files with 24 additions and 1 deletions

View file

@ -19,7 +19,8 @@ journalShow
-> Maybe Int -> Maybe Int
-> MateHandler [JournalEntry] -> MateHandler [JournalEntry]
journalShow (Just (uid, method)) mlimit moffset = do journalShow (Just (uid, method)) mlimit moffset = do
if method `elem` [PrimaryPass, ChallengeResponse] maySeeJournal <- checkCapability uid roleCanManageJournal
if method `elem` [PrimaryPass, ChallengeResponse] && maySeeJournal
then do then do
conn <- asks rsConnection conn <- asks rsConnection
selectJournalEntries mlimit moffset conn selectJournalEntries mlimit moffset conn

22
src/Types/Settings.hs Normal file
View file

@ -0,0 +1,22 @@
{-# LANGUAGE TypeFamilies #-}
module Types.Settings where
import qualified Data.Text as T
data Settings = Settings
{ settingsCurrency :: T.Text
, settingsDecimalPlaces :: Int
, settingsBlockRegistration :: Bool
}
instance ToDatabase Settings where
data InTuple Settings = (T.Text, Int, Bool)
toDatabase (Settings currency places reg) = (currency, places, reg)
instance FromDatabase Settins where
data OutTuple Settings = (T.Text, Int, Bool)
fromDatabase (currency, places, reg) = Settings currency places reg