|
|
@@ -3,6 +3,7 @@ import type { Request, RequestHandler } from 'express';
|
|
|
import { type ValidationChain, param, body } from 'express-validator';
|
|
|
import { isHttpError } from 'http-errors';
|
|
|
|
|
|
+import { SCOPE } from '~/interfaces/scope';
|
|
|
import type Crowi from '~/server/crowi';
|
|
|
import { accessTokenParser } from '~/server/middlewares/access-token-parser';
|
|
|
import { apiV3FormValidator } from '~/server/middlewares/apiv3-form-validator';
|
|
|
@@ -38,7 +39,7 @@ export const setDefaultAiAssistantFactory: setDefaultAiAssistantFactory = (crowi
|
|
|
];
|
|
|
|
|
|
return [
|
|
|
- accessTokenParser, loginRequiredStrictly, adminRequired, certifyAiService, validator, apiV3FormValidator,
|
|
|
+ accessTokenParser([SCOPE.WRITE.BASE.AI_ASSISTANT]), loginRequiredStrictly, adminRequired, certifyAiService, validator, apiV3FormValidator,
|
|
|
async(req: Req, res: ApiV3Response) => {
|
|
|
const openaiService = getOpenaiService();
|
|
|
if (openaiService == null) {
|