databrary-1: Databrary

Safe HaskellNone
LanguageHaskell2010

Model.Audit

Synopsis

Documentation

type MonadAudit c m = (MonadHasRequest c m, MonadHas (Id Party) c m, MonadDB c m) Source #

A context which carries enough information to enter audit data along with viewing or data modification actions. The request allows us to get the web requests IP. The party id provides us with the party who is performing auditable actions. The DB gives us a connection to create data in the audit tables.

getRemoteIp :: MonadHasRequest c m => m PGInet Source #

Retrieve the IP from the web request, if any is present

getAuditIdentity :: (MonadHasRequest c m, MonadHas (Id Party) c m) => m AuditIdentity Source #

Build up an identity summarizing the party and IP during a given action