diff --git a/web/app/libs/uoj-html-lib.php b/web/app/libs/uoj-html-lib.php
index 207fafd..8580925 100644
--- a/web/app/libs/uoj-html-lib.php
+++ b/web/app/libs/uoj-html-lib.php
@@ -467,9 +467,9 @@ function echoSubmissionsList($cond, $tail, $config, $user) {
$table_name = isset($config['table_name']) ? $config['table_name'] : 'submissions';
- if (!isSuperUser($user)) {
+ if (!isProblemManager($user)) {
if ($user != null) {
- $permission_cond = "submissions.is_hidden = false or (submissions.is_hidden = true and submissions.problem_id in (select problem_id from problems_permissions where username = '{$user['username']}'))";
+ $permission_cond = "submissions.is_hidden = false or submissions.submitter = '{$user['username']}' or (submissions.is_hidden = true and (submissions.problem_id in (select problem_id from problems_permissions where username = '{$user['username']}') or submissions.problem_id in (select id from problems where uploader = '{$user['username']}')))";
} else {
$permission_cond = "submissions.is_hidden = false";
}
diff --git a/web/app/libs/uoj-query-lib.php b/web/app/libs/uoj-query-lib.php
index 2080050..75988d9 100644
--- a/web/app/libs/uoj-query-lib.php
+++ b/web/app/libs/uoj-query-lib.php
@@ -200,7 +200,7 @@ function isContestProblemVisibleToUser($problem, $contest, $user) {
}
function isSubmissionVisibleToUser($submission, $problem, $user) {
- if (isSuperUser($user)) {
+ if (isProblemManager($user)) {
return true;
} elseif (!$submission['is_hidden']) {
return true;
diff --git a/web/app/libs/uoj-utility-lib.php b/web/app/libs/uoj-utility-lib.php
index d958ed1..89c649a 100644
--- a/web/app/libs/uoj-utility-lib.php
+++ b/web/app/libs/uoj-utility-lib.php
@@ -163,6 +163,9 @@ function isProblemManager($user) {
if ($user == null) {
return false;
}
+ if (isSuperUser($user)) {
+ return true;
+ }
return hasUserType($user, 'problem_manager');
}
function isContestJudger($user) {