Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- packageversion :: PackageVersion
- progname :: ProgramName
- prognameandversion :: String
- webflags :: [Flag RawOpts]
- webmode :: Mode RawOpts
- data WebOpts = WebOpts {}
- defwebopts :: WebOpts
- rawOptsToWebOpts :: RawOpts -> IO WebOpts
- checkWebOpts :: WebOpts -> WebOpts
- getHledgerWebOpts :: IO WebOpts
- data Permission
- parsePermission :: ByteString -> Either Text Permission
- showPermission :: Permission -> String
- data AccessLevel
- parseAccessLevel :: String -> Either String AccessLevel
- accessLevelToPermissions :: AccessLevel -> [Permission]
- simplePolicyWithOrigin :: Origin -> CorsResourcePolicy
- corsPolicyFromString :: String -> Middleware
- corsPolicy :: WebOpts -> Application -> Application
Documentation
progname :: ProgramName Source #
The name of this program's executable.
prognameandversion :: String Source #
Generate the version string for this program. The template haskell call is here rather than in Hledger.Cli.Version to avoid wasteful recompilation.
defwebopts :: WebOpts Source #
checkWebOpts :: WebOpts -> WebOpts Source #
data Permission Source #
ViewPermission | allow viewing things (read only) |
AddPermission | allow adding transactions, or more generally allow appending text to input files |
EditPermission | allow editing input files |
Instances
showPermission :: Permission -> String Source #
Convert to the lower case permission name.
data AccessLevel Source #
For the --allow option: how much access to allow to hledger-web users ?
ViewAccess | view permission only |
AddAccess | view and add permissions |
EditAccess | view, add and edit permissions |
SandstormAccess | the permissions specified by the X-Sandstorm-Permissions HTTP request header |
Instances
accessLevelToPermissions :: AccessLevel -> [Permission] Source #
Convert an --allow access level to the permissions used internally. SandstormAccess generates an empty list, to be filled in later.
corsPolicy :: WebOpts -> Application -> Application Source #