parent
c4ee95a40a
commit
5b5a1f08e1
|
|
@ -19,6 +19,7 @@
|
|||
- Fix: 投票が終了した後に投票結果が正しく表示されない問題を修正
|
||||
|
||||
### Server
|
||||
- Enhance: 管理者/モデレーターはファイルのアップロード制限をバイパスするように
|
||||
- Enhance: セキュリティの向上
|
||||
|
||||
## 2025.10.0
|
||||
|
|
|
|||
|
|
@ -517,8 +517,10 @@ export class DriveService {
|
|||
this.registerLogger.debug(`ADD DRIVE FILE: user ${user?.id ?? 'not set'}, name ${detectedName}, tmp ${path}`);
|
||||
|
||||
//#region Check drive usage and mime type
|
||||
if (user && !isLink) {
|
||||
if (user != null && !isLink) {
|
||||
const isLocalUser = this.userEntityService.isLocalUser(user);
|
||||
const isModerator = isLocalUser ? await this.roleService.isModerator(user) : false;
|
||||
if (!isModerator) {
|
||||
const policies = await this.roleService.getUserPolicies(user.id);
|
||||
|
||||
const allowedMimeTypes = policies.uploadableFileTypes;
|
||||
|
|
@ -553,6 +555,7 @@ export class DriveService {
|
|||
await this.expireOldFile(await this.usersRepository.findOneByOrFail({ id: user.id }) as MiRemoteUser, driveCapacity - info.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const fetchFolder = async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue