mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-05 03:05:52 +02:00
feat: ロールでアップロード可能なファイル種別を設定可能に (#16081)
* wip * Update RoleService.ts * wip * Update RoleService.ts * Update CHANGELOG.md
This commit is contained in:
@@ -65,6 +65,7 @@ export type RolePolicies = {
|
||||
canImportMuting: boolean;
|
||||
canImportUserLists: boolean;
|
||||
chatAvailability: 'available' | 'readonly' | 'unavailable';
|
||||
uploadableFileTypes: string[];
|
||||
};
|
||||
|
||||
export const DEFAULT_POLICIES: RolePolicies = {
|
||||
@@ -101,6 +102,13 @@ export const DEFAULT_POLICIES: RolePolicies = {
|
||||
canImportMuting: true,
|
||||
canImportUserLists: true,
|
||||
chatAvailability: 'available',
|
||||
uploadableFileTypes: [
|
||||
'text/plain',
|
||||
'application/json',
|
||||
'image/*',
|
||||
'video/*',
|
||||
'audio/*',
|
||||
],
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
@@ -412,6 +420,16 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
||||
canImportMuting: calc('canImportMuting', vs => vs.some(v => v === true)),
|
||||
canImportUserLists: calc('canImportUserLists', vs => vs.some(v => v === true)),
|
||||
chatAvailability: calc('chatAvailability', aggregateChatAvailability),
|
||||
uploadableFileTypes: calc('uploadableFileTypes', vs => {
|
||||
const set = new Set<string>();
|
||||
for (const v of vs) {
|
||||
for (const type of v) {
|
||||
if (type.trim() === '') continue;
|
||||
set.add(type.trim());
|
||||
}
|
||||
}
|
||||
return [...set];
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user