@ -18,8 +18,6 @@ const tab = ref<'comments' | 'audits'>('comments')
const { isUIAllowed } = useRoles()
const { appInfo } = useGlobal()
const hasEditPermission = computed(() => isUIAllowed('commentEdit'))
const editLog = ref<AuditType>()
@ -61,7 +61,6 @@ export class AuditsController {
@Request() req,
@Body() body: any,
) {
console.log('heeeeeeeee')
return await this.auditsService.commentUpdate({
auditId,
userEmail: req.user?.email,
@ -93,6 +93,9 @@ export class AuditsService {
);
const log = await Audit.get(param.auditId);
if (log.op_type !== AuditOperationTypes.COMMENT) {
NcError.forbidden('Only comments can be updated');
}
if (log.user !== param.userEmail) {
NcError.unauthorized('Unauthorized access');