限制试卷分享和删除权限
- 只有自己创建的试卷才能分享给其他用户 - 只有自己创建的试卷才能删除 - 别人分享的试卷只显示考试、记录、答案、打印功能 - 使用 is_shared 字段判断试卷所有权 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
e3e0671204
commit
a77242c844
@ -324,6 +324,8 @@ const ExamManagement: React.FC = () => {
|
||||
>
|
||||
{exam.has_in_progress_exam ? '继续' : '考试'}
|
||||
</Button>,
|
||||
// 只有自己创建的试卷才能分享
|
||||
!exam.is_shared && (
|
||||
<Button
|
||||
type="text"
|
||||
icon={<ShareAltOutlined />}
|
||||
@ -331,7 +333,8 @@ const ExamManagement: React.FC = () => {
|
||||
className={styles.actionButton}
|
||||
>
|
||||
分享
|
||||
</Button>,
|
||||
</Button>
|
||||
),
|
||||
<Button
|
||||
type="text"
|
||||
icon={<HistoryOutlined />}
|
||||
@ -356,6 +359,8 @@ const ExamManagement: React.FC = () => {
|
||||
>
|
||||
打印
|
||||
</Button>,
|
||||
// 只有自己创建的试卷才能删除
|
||||
!exam.is_shared && (
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
@ -365,7 +370,8 @@ const ExamManagement: React.FC = () => {
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]}
|
||||
)
|
||||
].filter(Boolean)}
|
||||
>
|
||||
<div className={styles.cardContent}>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user