fix(backend): add missing kind definition for admin endpoints to improve security
This commit is contained in:
parent
776eea736a
commit
5150053275
77 changed files with 153 additions and 2 deletions
|
@ -12,6 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
@ -39,7 +41,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
if (user == null) {
|
||||
throw new Error('user not found');
|
||||
}
|
||||
|
||||
|
||||
if (user.avatarId == null) return;
|
||||
|
||||
await this.usersRepository.update(user.id, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue