mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 17:29:44 +00:00
Group role (#2993)
* feat: app/dataset support group (#2898) * pref: member-group (#2862) * feat: group list ordered by updateTime * fix: transfer ownership of group when deleting member * fix: i18n fix * feat: can not set member as admin/owner when user is not active * fix: GroupInfoModal hover input do not change color * fix(fe): searchinput do not scroll * feat: app collaborator with group, remove default permission * feat: dataset collaborator with group, remove default permission * chore(test): pref mock * chore: remove useless code * chore: adjust * fix: add self as collaborator when creating folder * fix(fe): folder manage menu do not show when user has write permission only * fix: dataset folder create * feat: Add code comment * Pref: app move (#2952) * perf: app schema * doc --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import { ParentIdType } from '@fastgpt/global/common/parentFolder/type';
|
||||
import { splitCombinePluginId } from '../../../core/app/plugin/controller';
|
||||
import { PluginSourceEnum } from '@fastgpt/global/core/plugin/constants';
|
||||
import { AuthModeType, AuthResponseType } from '../type';
|
||||
import { AppDefaultPermissionVal } from '@fastgpt/global/support/permission/app/constant';
|
||||
|
||||
export const authPluginByTmbId = async ({
|
||||
tmbId,
|
||||
@@ -60,7 +61,6 @@ export const authAppByTmbId = async ({
|
||||
if (isRoot) {
|
||||
return {
|
||||
...app,
|
||||
defaultPermission: app.defaultPermission,
|
||||
permission: new AppPermission({ isOwner: true })
|
||||
};
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export const authAppByTmbId = async ({
|
||||
|
||||
const isOwner = tmbPer.isOwner || String(app.tmbId) === String(tmbId);
|
||||
|
||||
const { Per, defaultPermission } = await (async () => {
|
||||
const { Per } = await (async () => {
|
||||
if (
|
||||
AppFolderTypeList.includes(app.type) ||
|
||||
app.inheritPermission === false ||
|
||||
@@ -86,10 +86,9 @@ export const authAppByTmbId = async ({
|
||||
resourceId: appId,
|
||||
resourceType: PerResourceTypeEnum.app
|
||||
});
|
||||
const Per = new AppPermission({ per: rp ?? app.defaultPermission, isOwner });
|
||||
const Per = new AppPermission({ per: rp ?? AppDefaultPermissionVal, isOwner });
|
||||
return {
|
||||
Per,
|
||||
defaultPermission: app.defaultPermission
|
||||
Per
|
||||
};
|
||||
} else {
|
||||
// is not folder and inheritPermission is true and is not root folder.
|
||||
@@ -104,8 +103,7 @@ export const authAppByTmbId = async ({
|
||||
isOwner
|
||||
});
|
||||
return {
|
||||
Per,
|
||||
defaultPermission: parent.defaultPermission
|
||||
Per
|
||||
};
|
||||
}
|
||||
})();
|
||||
@@ -116,7 +114,6 @@ export const authAppByTmbId = async ({
|
||||
|
||||
return {
|
||||
...app,
|
||||
defaultPermission,
|
||||
permission: Per
|
||||
};
|
||||
})();
|
||||
|
Reference in New Issue
Block a user