fix: harden permission-gated UI — minimum-org endpoint, modal/Popconfirm fail-closed on revocation

This commit is contained in:
2026-07-23 14:15:52 +08:00
parent f39136d9ce
commit 3ac99b808e
11 changed files with 282 additions and 142 deletions

View File

@@ -1434,9 +1434,9 @@ const StudentProfileContent: React.FC<StudentProfileContentProps> = ({
return;
}
api
.get('/organizations', { params: { includeArchived: 'false' } })
.get('/organizations/options')
.then((res: unknown) => {
setOrganizations(res as Array<{ id: number; name: string }>);
setOrganizations(res as Array<{ id: number; name: string; isHost?: boolean }>);
})
.catch(() => {});
}, [canLoadOrganizations]);
@@ -1454,7 +1454,11 @@ const StudentProfileContent: React.FC<StudentProfileContentProps> = ({
}
}, [studentId]);
const handleViewSensitive = useViewSensitive(studentId, '学生档案');
const handleViewSensitive = useViewSensitive(
studentId,
'学生档案',
hasPermission('log:create'),
);
const tabItems = useMemo(() => {
if (!aggregateData) return [];