mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(api): enforce single-role MFA, fix reindex and NCMEC scans (#2080)
This commit is contained in:
1 parent
8d21c97d08
commit
82941c08c9
4 files changed
+72
-16
No files matched your search
@@ -42,7 +42,7 @@ export class GuildMemberRoleService {
|
||||
requestCache: RequestCache;
|
||||
}): Promise<void> {
|
||||
const {userId, targetId, guildId, roleId} = params;
|
||||
const {guildData, canManageRoles} = await this.authService.getGuildAuthenticated({userId, guildId});
|
||||
const {guildData, hasPermission, canManageRoles} = await this.authService.getGuildAuthenticated({userId, guildId});
|
||||
const targetMember = await this.guildRepository.getMember(guildId, targetId);
|
||||
if (!targetMember) throw new UnknownGuildMemberError();
|
||||
await this.validationService.validateRoleAssignment({
|
||||
@@ -51,6 +51,7 @@ export class GuildMemberRoleService {
|
||||
userId,
|
||||
targetId,
|
||||
roleId,
|
||||
hasPermission,
|
||||
canManageRoles,
|
||||
});
|
||||
if (targetMember.roleIds.has(roleId)) return;
|
||||
@@ -75,7 +76,7 @@ export class GuildMemberRoleService {
|
||||
requestCache: RequestCache;
|
||||
}): Promise<void> {
|
||||
const {userId, targetId, guildId, roleId} = params;
|
||||
const {guildData, canManageRoles} = await this.authService.getGuildAuthenticated({userId, guildId});
|
||||
const {guildData, hasPermission, canManageRoles} = await this.authService.getGuildAuthenticated({userId, guildId});
|
||||
const targetMember = await this.guildRepository.getMember(guildId, targetId);
|
||||
if (!targetMember) throw new UnknownGuildMemberError();
|
||||
await this.validationService.validateRoleAssignment({
|
||||
@@ -84,6 +85,7 @@ export class GuildMemberRoleService {
|
||||
userId,
|
||||
targetId,
|
||||
roleId,
|
||||
hasPermission,
|
||||
canManageRoles,
|
||||
});
|
||||
if (!targetMember.roleIds.has(roleId)) return;
|
||||
|
||||
Reference in new issue
Block a user