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 qualified Network.Wai as W (pathInfo)
|
||||||
|
|
||||||
|
import Yesod.Core.Types (HandlerContents)
|
||||||
import qualified Yesod.Core.Unsafe as Unsafe
|
import qualified Yesod.Core.Unsafe as Unsafe
|
||||||
import qualified Data.CaseInsensitive as CI
|
import qualified Data.CaseInsensitive as CI
|
||||||
|
|
||||||
@ -205,10 +206,13 @@ navAccess = execStateT $ do
|
|||||||
guardM $ not . null <$> use _navChildren
|
guardM $ not . null <$> use _navChildren
|
||||||
|
|
||||||
navLinkAccess :: forall m. (MonadHandler m, HandlerSite m ~ UniWorX, MonadCatch m) => NavLink -> m Bool
|
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
|
where
|
||||||
|
shortCircuit :: HandlerContents -> m Bool
|
||||||
|
shortCircuit _ = return False
|
||||||
|
|
||||||
accessCheck :: HasRoute UniWorX route => NavType -> route -> m Bool
|
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
|
getTimeLocale' :: [Lang] -> TimeLocale
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user