stuff
This commit is contained in:
parent
998474640c
commit
cad5239b87
2 changed files with 24 additions and 1 deletions
|
@ -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
22
src/Types/Settings.hs
Normal 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
|
Loading…
Reference in a new issue