enhance: make configurable to whether notes search available by role

Resolve #10318
This commit is contained in:
syuilo 2023-03-13 17:52:24 +09:00
parent 7f16b50e73
commit 5d1ccb9bdc
7 changed files with 48 additions and 19 deletions

View file

@ -21,6 +21,7 @@ export type RolePolicies = {
canPublicNote: boolean;
canInvite: boolean;
canManageCustomEmojis: boolean;
canSearchNotes: boolean;
canHideAds: boolean;
driveCapacityMb: number;
pinLimit: number;
@ -40,6 +41,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
canPublicNote: true,
canInvite: false,
canManageCustomEmojis: false,
canSearchNotes: false,
canHideAds: false,
driveCapacityMb: 100,
pinLimit: 5,
@ -264,6 +266,7 @@ export class RoleService implements OnApplicationShutdown {
canPublicNote: calc('canPublicNote', vs => vs.some(v => v === true)),
canInvite: calc('canInvite', vs => vs.some(v => v === true)),
canManageCustomEmojis: calc('canManageCustomEmojis', vs => vs.some(v => v === true)),
canSearchNotes: calc('canSearchNotes', vs => vs.some(v => v === true)),
canHideAds: calc('canHideAds', vs => vs.some(v => v === true)),
driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)),
pinLimit: calc('pinLimit', vs => Math.max(...vs)),