mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
4.6.4 (#588)
This commit is contained in:
@@ -45,9 +45,16 @@ export async function autChatCrud({
|
||||
}
|
||||
|
||||
// req auth
|
||||
const { tmbId, role } = await authUserRole(props);
|
||||
const { teamId, tmbId, role } = await authUserRole(props);
|
||||
|
||||
if (String(teamId) !== String(chat.teamId)) return Promise.reject(ChatErrEnum.unAuthChat);
|
||||
|
||||
if (role === TeamMemberRoleEnum.owner) return { uid: outLinkUid };
|
||||
if (String(tmbId) === String(chat.tmbId)) return { uid: outLinkUid };
|
||||
|
||||
// admin
|
||||
if (per === 'r' && role === TeamMemberRoleEnum.admin) return { uid: outLinkUid };
|
||||
|
||||
return Promise.reject(ChatErrEnum.unAuthChat);
|
||||
})();
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { DatasetDataItemType, DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import { AuthResponseType } from '@fastgpt/global/support/permission/type';
|
||||
import { DatasetDataItemType } from '@fastgpt/global/core/dataset/type';
|
||||
import { MongoDatasetData } from '@fastgpt/service/core/dataset/data/schema';
|
||||
import { authDatasetCollection } from '@fastgpt/service/support/permission/auth/dataset';
|
||||
import { AuthModeType } from '@fastgpt/service/support/permission/type';
|
||||
@@ -27,6 +26,7 @@ export async function authDatasetData({
|
||||
id: String(datasetData._id),
|
||||
q: datasetData.q,
|
||||
a: datasetData.a,
|
||||
chunkIndex: datasetData.chunkIndex,
|
||||
indexes: datasetData.indexes,
|
||||
datasetId: String(datasetData.datasetId),
|
||||
collectionId: String(datasetData.collectionId),
|
||||
|
Reference in New Issue
Block a user