From 5c12e7c34fdcd71d6f98096292642042cbdf50bb Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sat, 26 May 2018 06:59:54 +0000 Subject: [PATCH] Add project role op for opening tickets, require it for opening a ticket Before that only the project's sharer was authorized to open a ticket. Now everyone can, once given a role with the op. --- src/Vervis/Foundation.hs | 4 ++-- src/Vervis/Model/Role.hs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index 9fabd53..ea8108e 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -194,8 +194,8 @@ instance Yesod App where (WorkflowEnumCtorNewR shr _ _ , _ ) -> personOrGroupAdmin shr (WorkflowEnumCtorR shr _ _ _ , _ ) -> personOrGroupAdmin shr - (TicketsR shar _ , True) -> person shar - (TicketNewR _ _ , _ ) -> personAny + (TicketsR s j , True) -> projOp ProjOpOpenTicket s j + (TicketNewR s j , _ ) -> projOp ProjOpOpenTicket s j (TicketR user _ _ , True) -> person user (TicketEditR user _ _ , _ ) -> person user (TicketAcceptR s j _ , _ ) -> projOp ProjOpAcceptTicket s j diff --git a/src/Vervis/Model/Role.hs b/src/Vervis/Model/Role.hs index 4103f69..f6dbc6f 100644 --- a/src/Vervis/Model/Role.hs +++ b/src/Vervis/Model/Role.hs @@ -1,6 +1,6 @@ {- This file is part of Vervis. - - - Written in 2016 by fr33domlover . + - Written in 2016, 2018 by fr33domlover . - - ♡ Copying is an act of love. Please copy, reuse and share. - @@ -28,7 +28,8 @@ data RepoOperation = RepoOpPush deriving (Eq, Show, Read, Enum, Bounded) derivePersistField "RepoOperation" data ProjectOperation - = ProjOpAcceptTicket + = ProjOpOpenTicket + | ProjOpAcceptTicket | ProjOpCloseTicket | ProjOpReopenTicket | ProjOpRequestTicket