All solutions are visible now

All the data (except for the repo URL and dev outputs) could be
inferred, anyway. So it would not make much sense to hide it.
This commit is contained in:
Filip Gralinski 2021-08-21 15:15:10 +02:00
parent 9677c32cd5
commit 9f4942a657
4 changed files with 7 additions and 8 deletions

View File

@ -181,7 +181,7 @@ instance Yesod App where
isAuthorized UserInfoR _ = return Authorized
isAuthorized (ChallengeSubmissionJsonR _) _ = return Authorized
isAuthorized (ChallengeReadmeInMarkdownR _) _ = regularAuthorization
isAuthorized (QueryJsonR _) _ = return Authorized
isAuthorized (QueryJsonR _) _ = regularAuthorization
isAuthorized ListTagsJsonR _ = regularAuthorization
isAuthorized (ChallengeGraphDataR _) _ = regularAuthorization

View File

@ -151,8 +151,7 @@ findSubmissions :: Text -> Handler [(FullSubmissionInfo, [SHA1])]
findSubmissions sha1Prefix = do
mauthId <- maybeAuth
allSubmissions <- runDB $ rawCommitQuery sha1Prefix
submissions <- filterM (\sub -> runDB $ checkWhetherVisible (entityVal sub) (entityKey <$> mauthId)) allSubmissions
justSubmissions' <- mapM getFullInfo submissions
justSubmissions' <- mapM getFullInfo allSubmissions
let justSubmissions = map (\s -> (s, [])) justSubmissions'
outs <- runDB $ rawOutQuery sha1Prefix
@ -378,7 +377,7 @@ fetchViewVariantData variantId = do
(submissionChallenge theSubmission)
let tests = sortBy (flip testComparator) tests'
isViewable <- runDB $ checkWhetherVisible theSubmission (entityKey <$> mauthId)
let isViewable = True
if isViewable
then
@ -508,7 +507,7 @@ getOut :: Maybe UserId -> TableEntry -> WidgetFor App (Maybe (FilePath, FilePath
getOut mauthId entry = do
let variant = variantName $ entityVal $ tableEntryVariant entry
isViewable <- handlerToWidget $ runDB $ checkWhetherVisible (entityVal $ tableEntrySubmission entry) mauthId
let isViewable = True
if isViewable
then
do

View File

@ -1325,7 +1325,7 @@ convertTableEntryToView tests entry = do
mUserId <- maybeAuthPossiblyByToken
isReevaluable <- runDB $ canBeReevaluated $ entityKey $ tableEntrySubmission entry
isVisible <- runDB $ checkWhetherVisible submission (entityKey <$> mUserId)
let isVisible = True
return $ SubmissionView {
submissionViewId = fromSqlKey $ entityKey $ tableEntrySubmission entry,

View File

@ -282,7 +282,7 @@ extractInt ((PersistInt64 x):_) = x
statusCellWidget :: Text -> RepoScheme -> Repo -> (SubmissionId, Submission, VariantId, Variant, Maybe UserId) -> WidgetFor App ()
statusCellWidget challengeName repoScheme challengeRepo (submissionId, submission, variantId, _, mauthId) = do
isReevaluable <- handlerToWidget $ runDB $ canBeReevaluated submissionId
isVisible <- handlerToWidget $ runDB $ checkWhetherVisible submission mauthId
let isVisible = True
$(widgetFile "submission-status")
where commitHash = fromSHA1ToText $ submissionCommit submission
isPublic = submissionIsPublic submission
@ -405,7 +405,7 @@ toLeaderboardEntry challengeId tests ss = do
mUserId <- maybeAuthPossiblyByToken
isReevaluable <- runDB $ canBeReevaluated $ entityKey $ tableEntrySubmission bestOne
isVisible <- runDB $ checkWhetherVisible submission (entityKey <$> mUserId)
let isVisible = True
mTeam <- case submissionTeam $ entityVal bestSubmission of
Just teamId -> do