summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/RoleService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-09-24 10:33:30 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-09-24 10:33:30 +0900
commit2ad3b1fd74f20698be13a4beb5ee4b818ea0f090 (patch)
tree23b37a184f7e98fa4d7af49c44259f90565d3012 /packages/backend/src/core/RoleService.ts
parentfix: ノート通知で絵文字が使われている名前が絵文字で表... (diff)
downloadsharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.tar.gz
sharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.tar.bz2
sharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.zip
improve moderation log
Diffstat (limited to 'packages/backend/src/core/RoleService.ts')
-rw-r--r--packages/backend/src/core/RoleService.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts
index 39f21ecec4..dea6dc68cd 100644
--- a/packages/backend/src/core/RoleService.ts
+++ b/packages/backend/src/core/RoleService.ts
@@ -494,6 +494,19 @@ export class RoleService implements OnApplicationShutdown {
}
@bindThis
+ public async delete(role: MiRole, moderator?: MiUser): Promise<void> {
+ await this.rolesRepository.delete({ id: role.id });
+ this.globalEventService.publishInternalEvent('roleDeleted', role);
+
+ if (moderator) {
+ this.moderationLogService.log(moderator, 'deleteRole', {
+ roleId: role.id,
+ role: role,
+ });
+ }
+ }
+
+ @bindThis
public dispose(): void {
this.redisForSub.off('message', this.onMessage);
this.roleAssignmentByUserIdCache.dispose();