fix: fix #571
This commit is contained in:
parent
fefe604592
commit
aefb7e0b42
@ -24,6 +24,7 @@ import Auth.Dummy
|
||||
|
||||
import qualified Network.Wai as W (pathInfo)
|
||||
|
||||
import Yesod.Core.Types (HandlerContents)
|
||||
import qualified Yesod.Core.Unsafe as Unsafe
|
||||
import qualified Data.CaseInsensitive as CI
|
||||
|
||||
@ -205,10 +206,13 @@ navAccess = execStateT $ do
|
||||
guardM $ not . null <$> use _navChildren
|
||||
|
||||
navLinkAccess :: forall m. (MonadHandler m, HandlerSite m ~ UniWorX, MonadCatch m) => NavLink -> m Bool
|
||||
navLinkAccess NavLink{..} = liftHandler navAccess' `and2M` accessCheck navType navRoute
|
||||
navLinkAccess NavLink{..} = handle shortCircuit $ liftHandler navAccess' `and2M` accessCheck navType navRoute
|
||||
where
|
||||
shortCircuit :: HandlerContents -> m Bool
|
||||
shortCircuit _ = return False
|
||||
|
||||
accessCheck :: HasRoute UniWorX route => NavType -> route -> m Bool
|
||||
accessCheck nt (urlRoute -> route) = handleAll (\_ -> return False) $ bool hasWriteAccessTo hasReadAccessTo (is _NavTypeLink nt) route
|
||||
accessCheck nt (urlRoute -> route) = bool hasWriteAccessTo hasReadAccessTo (is _NavTypeLink nt) route
|
||||
|
||||
|
||||
getTimeLocale' :: [Lang] -> TimeLocale
|
||||
|
||||
Loading…
Reference in New Issue
Block a user