feat(audit): 收口领域写接口权限审计
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { ProtectedMutation } from '../../common/audit/protected-mutation.decorator';
|
||||
import { CreateBugDto } from './dto/create-bug.dto';
|
||||
import { UpdateBugDto } from './dto/update-bug.dto';
|
||||
import { BugService } from './bug.service';
|
||||
@@ -8,6 +9,11 @@ export class BugController {
|
||||
constructor(private readonly bugService: BugService) {}
|
||||
|
||||
@Post()
|
||||
@ProtectedMutation('version.bug:create', { versionIdParam: 'versionId' }, {
|
||||
action: 'bug.create',
|
||||
entityType: 'bug',
|
||||
versionIdParam: 'versionId',
|
||||
})
|
||||
create(@Param('versionId') versionId: string, @Body() dto: CreateBugDto) {
|
||||
return this.bugService.create(versionId, dto);
|
||||
}
|
||||
@@ -18,11 +24,23 @@ export class BugController {
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
@ProtectedMutation('version.bug:edit', { versionIdParam: 'versionId' }, {
|
||||
action: 'bug.update',
|
||||
entityType: 'bug',
|
||||
entityIdParam: 'id',
|
||||
versionIdParam: 'versionId',
|
||||
})
|
||||
update(@Param('versionId') versionId: string, @Param('id') id: string, @Body() dto: UpdateBugDto) {
|
||||
return this.bugService.update(versionId, id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id/status')
|
||||
@ProtectedMutation('version.bug:edit', { versionIdParam: 'versionId' }, {
|
||||
action: 'bug.status',
|
||||
entityType: 'bug',
|
||||
entityIdParam: 'id',
|
||||
versionIdParam: 'versionId',
|
||||
})
|
||||
updateStatus(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@@ -33,6 +51,12 @@ export class BugController {
|
||||
}
|
||||
|
||||
@Patch(':id/transfer')
|
||||
@ProtectedMutation('version.bug:edit', { versionIdParam: 'versionId' }, {
|
||||
action: 'bug.transfer',
|
||||
entityType: 'bug',
|
||||
entityIdParam: 'id',
|
||||
versionIdParam: 'versionId',
|
||||
})
|
||||
transfer(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@@ -43,6 +67,12 @@ export class BugController {
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ProtectedMutation('version.bug:delete', { versionIdParam: 'versionId' }, {
|
||||
action: 'bug.delete',
|
||||
entityType: 'bug',
|
||||
entityIdParam: 'id',
|
||||
versionIdParam: 'versionId',
|
||||
})
|
||||
remove(@Param('versionId') versionId: string, @Param('id') id: string) {
|
||||
return this.bugService.remove(versionId, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user