enhance: ウォーターマーク機能をロールで制御可能に

This commit is contained in:
syuilo
2025-07-12 15:13:35 +09:00
parent d2c4f79886
commit 5ecaf5095e
11 changed files with 49 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ export type RolePolicies = {
chatAvailability: 'available' | 'readonly' | 'unavailable';
uploadableFileTypes: string[];
noteDraftLimit: number;
watermarkAvailable: boolean;
};
export const DEFAULT_POLICIES: RolePolicies = {
@@ -111,6 +112,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
'audio/*',
],
noteDraftLimit: 10,
watermarkAvailable: true,
};
@Injectable()
@@ -433,6 +435,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
return [...set];
}),
noteDraftLimit: calc('noteDraftLimit', vs => Math.max(...vs)),
watermarkAvailable: calc('watermarkAvailable', vs => vs.some(v => v === true)),
};
}

View File

@@ -313,6 +313,10 @@ export const packedRolePoliciesSchema = {
type: 'integer',
optional: false, nullable: false,
},
watermarkAvailable: {
type: 'boolean',
optional: false, nullable: false,
},
},
} as const;