diff --git a/Foundation.hs b/Foundation.hs index 9829a39..f431e87 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -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 diff --git a/Handler/Query.hs b/Handler/Query.hs index 19ce04e..f0c9212 100644 --- a/Handler/Query.hs +++ b/Handler/Query.hs @@ -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 diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index 461c54e..376ec0c 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -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, diff --git a/Handler/Tables.hs b/Handler/Tables.hs index abd09d9..3464958 100644 --- a/Handler/Tables.hs +++ b/Handler/Tables.hs @@ -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