Re: [web-devel] [Yesod] Re: Abstracting permissions with Yesod

27 Aug
2012
27 Aug
'12
9:15 a.m.
On Mon, Aug 27, 2012 at 5:52 AM, Arthur Clemens
Did something change in Yesod? This part doesn't seem to work:
isAuthorized route isWrite = do mauth <- maybeAuth runDB $ mauth `isAuthorizedTo` permissionsRequiredFor route isWrite
Returns
Foundation.hs:109:20: Couldn't match expected type `(UserId, User)' with actual type `Entity val0'
To fix this bug you'll need to change all '(UserId, User)'s into 'Entity User's. For example: hasPermissionTo :: Entity User -> Permission -> YesodDB sub Blog AuthResult (Entity _ user) `hasPermissionTo` Post = ... etc. I'm not sure if there's anything else missing. Cheers, =) -- Felipe.
4649
Age (days ago)
4649
Last active (days ago)
0 comments
1 participants
participants (1)
-
Felipe Almeida Lessa