From e2ef279515fae89f64925bd746d8c65091530bd1 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Wed, 25 May 2016 22:38:21 +0000 Subject: [PATCH] Add missing routes to isAuthorized --- src/Vervis/Foundation.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index 2d8df8b..718d691 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -119,16 +119,24 @@ instance Yesod App where isAuthorized r w = case (r, w) of (GroupsR , True) -> loggedIn (GroupNewR , _) -> loggedIn - (ProjectNewR user , _) -> loggedInAs user - (RepoNewR user , _) -> loggedInAs user + (KeysR , _) -> loggedIn (KeyR _key , _) -> loggedIn (KeyNewR , _) -> loggedIn + + (ReposR shar , True) -> loggedInAs shar + (RepoNewR user , _) -> loggedInAs user (RepoR shar _ , True) -> loggedInAs shar + + (ProjectsR shar , True) -> loggedInAs shar + (ProjectNewR user , _) -> loggedInAs user + + (TicketsR shar _ , True) -> loggedInAs shar (TicketNewR _ _ , _) -> loggedIn (TicketR user _ _ , True) -> loggedInAs user (TicketEditR user _ _ , _) -> loggedInAs user (TicketDiscussionR _ _ _ , True) -> loggedIn + (TicketMessageR _ _ _ _ , True) -> loggedIn (TicketTopReplyR _ _ _ , _) -> loggedIn (TicketReplyR _ _ _ _ , _) -> loggedIn _ -> return Authorized