Only show submission form if authorized
This commit is contained in:
parent
03a785abc2
commit
a7fb5a7d9e
@ -246,6 +246,8 @@ submissionHelper tid csh shn (SubmissionMode mcid) = do
|
|||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
|
|
||||||
actionUrl <- Data.Maybe.fromJust <$> getCurrentRoute
|
actionUrl <- Data.Maybe.fromJust <$> getCurrentRoute
|
||||||
|
maySubmit <- (== Authorized) <$> isAuthorized actionUrl True
|
||||||
|
|
||||||
-- Maybe construct a table to display uploaded archive files
|
-- Maybe construct a table to display uploaded archive files
|
||||||
let colonnadeFiles :: _ -> Colonnade Sortable _ (DBCell (WidgetT UniWorX IO) ())
|
let colonnadeFiles :: _ -> Colonnade Sortable _ (DBCell (WidgetT UniWorX IO) ())
|
||||||
colonnadeFiles cid = mconcat
|
colonnadeFiles cid = mconcat
|
||||||
@ -355,7 +357,8 @@ getSubArchiveR tid csh shn cID@CryptoID{..} (ZIPArchiveName sfType) = do
|
|||||||
|
|
||||||
fileSource' = do
|
fileSource' = do
|
||||||
fileSource .| Conduit.map entityVal
|
fileSource .| Conduit.map entityVal
|
||||||
maybe (return ()) (yieldM . ratingFile cID) rating
|
when (sfType == SubmissionCorrected) $
|
||||||
|
maybe (return ()) (yieldM . ratingFile cID) rating
|
||||||
|
|
||||||
zipComment = Text.encodeUtf8 . pack $ CI.foldedCase ciphertext
|
zipComment = Text.encodeUtf8 . pack $ CI.foldedCase ciphertext
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ $maybe cID <- mcid
|
|||||||
<h3>_{MsgSubmissionFiles}
|
<h3>_{MsgSubmissionFiles}
|
||||||
^{fileTable}
|
^{fileTable}
|
||||||
|
|
||||||
<section>
|
$if maySubmit
|
||||||
<form .form-horizontal method=post action=@{actionUrl} enctype=#{formEnctype}>
|
<section>
|
||||||
^{formWidget}
|
<form .form-horizontal method=post action=@{actionUrl} enctype=#{formEnctype}>
|
||||||
|
^{formWidget}
|
||||||
|
|||||||
Reference in New Issue
Block a user