|
@@ -57,14 +57,14 @@ public class PaperController extends BaseSearchController{
|
|
|
String permissionStr = userId.toString() + ":paper:*:" + paperId.toString();
|
|
|
boolean isOwner = SecurityUtils.getSubject().isPermitted(new PaperPermission(permissionStr));
|
|
|
boolean isAdmin = roleLogic.isAdmin(userId);
|
|
|
- boolean isStudentFromExam = (examId == null);
|
|
|
+ boolean isStudentFromExam = (examId != null);
|
|
|
if (!isOwner && !isAdmin && !isStudentFromExam) {
|
|
|
throw new UnauthenticatedException("forbidden");
|
|
|
}
|
|
|
|
|
|
// 试卷在考试开始前的同学应该看不到
|
|
|
- ExamVO exam = examLogic.getExamByIdAndParticipantIdIfPermited(examId, userId);
|
|
|
if (isStudentFromExam) {
|
|
|
+ ExamVO exam = examLogic.getExamByIdAndParticipantIdIfPermited(examId, userId);
|
|
|
if (exam.getStatus().equals(Exam.STATUS_UPCOMING)) {
|
|
|
throw new UnauthenticatedException("forbidden");
|
|
|
}
|