1
0
forked from mirror/misskey

Enhance: モデレーター以上は制限の影響を受けないように

This commit is contained in:
KanariKanaru 2024-10-11 18:29:21 +09:00 committed by kakkokari-gtyih
parent 9cd17f4ec5
commit fc4cdecae3

View File

@ -458,7 +458,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const newName = updates.name === undefined ? user.name : updates.name;
if (newName != null) {
const hasProhibitedWords = this.checkScreennameProhibitedWordsContain(newName, this.instanceMeta.prohibitedPartialScreenNames);
let hasProhibitedWords = false;
if (!await this.roleService.isModerator(user)) {
hasProhibitedWords = this.checkScreennameProhibitedWordsContain(newName, this.instanceMeta.prohibitedPartialScreenNames);
}
if (hasProhibitedWords) {
throw new ApiError(meta.errors.screenNameContainsProhibitedWords);
}