databrary-1: Databrary

Safe HaskellNone
LanguageHaskell2010

Controller.Permission

Synopsis

Documentation

checkPermissionOld :: Has Permission a => Permission -> a -> Handler a Source #

Deprecated: Use checkPermission instead

checkPermission Source #

Arguments

:: (a -> Permission)

How to extract the granted permission for current user

-> Permission

Requested permission permission

-> a

Object under scrutiny

-> Handler a

Just returns the 3rd arg, unless it short-circuits with a 403.

Determine if the requested permission is granted, or throw an HTTP 403.

This function is probably due for another 3 or 4 rewrites: it's a bit abstract, serving mostly as a description for its arguments. TODO: Maybe replace with requestAccess

userCanReadData :: (a -> EffectiveRelease) -> (a -> VolumeRolePolicy) -> a -> Handler a Source #

authAccount :: Handler Account Source #

Pulls the Account out of the Handler context

checkMemberADMIN :: Handler () Source #

(Maybe) tests whether someone is a superadmin?

guardVerfHeader :: Handler () Source #