feat(policies): account removal policy

This commit is contained in:
무라쿠모 2024-05-11 21:55:40 +09:00
parent fdb49bc2e4
commit 0ec6a0fbfb
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
9 changed files with 45 additions and 10 deletions

View file

@ -68,6 +68,7 @@ export type RolePolicies = {
userEachUserListsLimit: number;
rateLimitFactor: number;
avatarDecorationLimit: number;
canUseAccountRemoval: boolean;
};
export const DEFAULT_POLICIES: RolePolicies = {
@ -106,6 +107,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
userEachUserListsLimit: 50,
rateLimitFactor: 1,
avatarDecorationLimit: 1,
canUseAccountRemoval: true,
};
@Injectable()
@ -389,6 +391,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
canCreateContent: calc('canCreateContent', vs => vs.some(v => v === true)),
canUpdateContent: calc('canUpdateContent', vs => vs.some(v => v === true)),
canDeleteContent: calc('canDeleteContent', vs => vs.some(v => v === true)),
canUseAccountRemoval: calc('canUseAccountRemoval', vs => vs.some(v => v === true)),
canPurgeAccount: calc('canPurgeAccount', vs => vs.some(v => v === true)),
canUpdateAvatar: calc('canUpdateAvatar', vs => vs.some(v => v === true)),
canUpdateBanner: calc('canUpdateBanner', vs => vs.some(v => v === true)),