fix(web/submission_list): sql for view permission
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-11-06 15:00:59 +08:00
parent e1a4c8ffa3
commit f3ce28c1f7
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -392,13 +392,13 @@ function echoSubmissionsList($cond, $tail, $config, $user) {
if (!isProblemManager($user)) { if (!isProblemManager($user)) {
if ($user != null) { if ($user != null) {
$permission_cond = DB::lor([ $permission_cond = DB::lor([
"submissions.is_hidden" => "false", "submissions.is_hidden" => false,
"submissions.submitter" => $user['username'], "submissions.submitter" => $user['username'],
DB::land([ DB::land([
"submissions.is_hidden" => true, "submissions.is_hidden" => true,
DB::lor([ DB::lor([
"submissions.problem_id in (select problem_id from problems_permissions where username = '{$user['username']}')", "submissions.problem_id in (select problem_id from problems_permissions where username = '{$user['username']}')",
"submissions.problem_id in (select id from problems where uploader = '{$user['username']}'))", "submissions.problem_id in (select id from problems where uploader = '{$user['username']}')",
]), ]),
]), ]),
]); ]);