Enhance: モデレーター以上は制限の影響を受けないように
This commit is contained in:
parent
9cd17f4ec5
commit
fc4cdecae3
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue