mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
enhance: ウォーターマーク機能をロールで制御可能に
This commit is contained in:
@@ -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)),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -313,6 +313,10 @@ export const packedRolePoliciesSchema = {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
watermarkAvailable: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user