The SecPAL authorization logic ported to Haskell