Remove auth error messages
This commit is contained in:
parent
ec49a4c424
commit
29cf2f853b
1 changed files with 18 additions and 23 deletions
|
@ -119,20 +119,15 @@ instance Yesod App where
|
|||
isAuthorized r w = case (r, w) of
|
||||
(GroupsR , True) -> loggedIn
|
||||
(GroupNewR , _) -> loggedIn
|
||||
(ProjectNewR user , _) ->
|
||||
loggedInAs user "You can’t create projects for other users"
|
||||
(RepoNewR user , _) ->
|
||||
loggedInAs user "You can’t create repos for other users"
|
||||
(ProjectNewR user , _) -> loggedInAs user
|
||||
(RepoNewR user , _) -> loggedInAs user
|
||||
(KeysR , _) -> loggedIn
|
||||
(KeyR _key , _) -> loggedIn
|
||||
(KeyNewR , _) -> loggedIn
|
||||
(RepoR shar _ , True) ->
|
||||
loggedInAs shar "You can’t modify repos for other users"
|
||||
(RepoR shar _ , True) -> loggedInAs shar
|
||||
(TicketNewR _ _ , _) -> loggedIn
|
||||
(TicketR user _ _ , True) ->
|
||||
loggedInAs user "Only project members can modify this ticket"
|
||||
(TicketEditR user _ _ , _) ->
|
||||
loggedInAs user "Only project members can modify this ticket"
|
||||
(TicketR user _ _ , True) -> loggedInAs user
|
||||
(TicketEditR user _ _ , _) -> loggedInAs user
|
||||
(TicketDiscussionR _ _ _ , True) -> loggedIn
|
||||
(TicketTopReplyR _ _ _ , _) -> loggedIn
|
||||
(TicketReplyR _ _ _ _ , _) -> loggedIn
|
||||
|
@ -229,8 +224,8 @@ loggedIn = do
|
|||
Nothing -> return AuthenticationRequired
|
||||
Just _pid -> return Authorized
|
||||
|
||||
loggedInAs :: ShrIdent -> Text -> Handler AuthResult
|
||||
loggedInAs ident msg = do
|
||||
loggedInAs :: ShrIdent -> Handler AuthResult
|
||||
loggedInAs ident = do
|
||||
mp <- maybeAuth
|
||||
case mp of
|
||||
Nothing -> return AuthenticationRequired
|
||||
|
@ -243,9 +238,9 @@ loggedInAs ident msg = do
|
|||
personLogin person <>
|
||||
" specified a nonexistent sharer ID"
|
||||
Just sharer ->
|
||||
if ident == sharerIdent sharer
|
||||
then return Authorized
|
||||
else return $ Unauthorized msg
|
||||
return $ if ident == sharerIdent sharer
|
||||
then Authorized
|
||||
else Unauthorized "No access to this operation"
|
||||
|
||||
instance YesodBreadcrumbs App where
|
||||
breadcrumb route = return $ case route of
|
||||
|
|
Loading…
Reference in a new issue