mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +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:
10
packages/global/core/app/collaborator.d.ts
vendored
10
packages/global/core/app/collaborator.d.ts
vendored
@@ -1,4 +1,8 @@
|
||||
import { UpdateClbPermissionProps } from '../../support/permission/collaborator';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
import {
|
||||
UpdateClbPermissionProps,
|
||||
UpdatePermissionBody
|
||||
} from '../../support/permission/collaborator';
|
||||
import { PermissionValueType } from '../../support/permission/type';
|
||||
|
||||
export type UpdateAppCollaboratorBody = UpdateClbPermissionProps & {
|
||||
@@ -7,5 +11,7 @@ export type UpdateAppCollaboratorBody = UpdateClbPermissionProps & {
|
||||
|
||||
export type AppCollaboratorDeleteParams = {
|
||||
appId: string;
|
||||
} & RequireOnlyOne<{
|
||||
tmbId: string;
|
||||
};
|
||||
groupId: string;
|
||||
}>;
|
||||
|
11
packages/global/core/app/type.d.ts
vendored
11
packages/global/core/app/type.d.ts
vendored
@@ -10,7 +10,6 @@ import { SelectedDatasetType } from '../workflow/api';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { TeamTagSchema as TeamTagsSchemaType } from '@fastgpt/global/support/user/team/type.d';
|
||||
import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { PermissionSchemaType, PermissionValueType } from '../../support/permission/type';
|
||||
import { AppPermission } from '../../support/permission/app/controller';
|
||||
import { ParentIdType } from '../../common/parentFolder/type';
|
||||
import { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
|
||||
@@ -45,7 +44,11 @@ export type AppSchema = {
|
||||
|
||||
inited?: boolean;
|
||||
teamTags: string[];
|
||||
} & PermissionSchemaType;
|
||||
inheritPermission?: boolean;
|
||||
|
||||
// abandon
|
||||
defaultPermission?: number;
|
||||
};
|
||||
|
||||
export type AppListItemType = {
|
||||
_id: string;
|
||||
@@ -57,7 +60,9 @@ export type AppListItemType = {
|
||||
updateTime: Date;
|
||||
pluginData?: AppSchema['pluginData'];
|
||||
permission: AppPermission;
|
||||
} & PermissionSchemaType;
|
||||
inheritPermission?: boolean;
|
||||
private?: boolean;
|
||||
};
|
||||
|
||||
export type AppDetailType = AppSchema & {
|
||||
permission: AppPermission;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { UpdateClbPermissionProps } from '../../support/permission/collaborator';
|
||||
import { PermissionValueType } from '../../support/permission/type';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
|
||||
export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & {
|
||||
datasetId: string;
|
||||
@@ -7,5 +8,7 @@ export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & {
|
||||
|
||||
export type DatasetCollaboratorDeleteParams = {
|
||||
datasetId: string;
|
||||
} & RequireOnlyOne<{
|
||||
tmbId: string;
|
||||
};
|
||||
groupId: string;
|
||||
}>;
|
||||
|
12
packages/global/core/dataset/type.d.ts
vendored
12
packages/global/core/dataset/type.d.ts
vendored
@@ -1,4 +1,3 @@
|
||||
import { PermissionSchemaType } from '../../support/permission/type';
|
||||
import type { LLMModelItemType, VectorModelItemType } from '../../core/ai/model.d';
|
||||
import { PermissionTypeEnum } from '../../support/permission/constant';
|
||||
import { PushDatasetDataChunkProps } from './api';
|
||||
@@ -32,8 +31,11 @@ export type DatasetSchemaType = {
|
||||
selector: string;
|
||||
};
|
||||
externalReadUrl?: string;
|
||||
} & PermissionSchemaType;
|
||||
// } & PermissionSchemaType;
|
||||
inheritPermission: boolean;
|
||||
|
||||
// abandon
|
||||
defaultPermission?: number;
|
||||
};
|
||||
|
||||
export type DatasetCollectionSchemaType = {
|
||||
_id: string;
|
||||
@@ -146,7 +148,9 @@ export type DatasetListItemType = {
|
||||
type: `${DatasetTypeEnum}`;
|
||||
permission: DatasetPermission;
|
||||
vectorModel: VectorModelItemType;
|
||||
} & PermissionSchemaType;
|
||||
inheritPermission: boolean;
|
||||
private?: boolean;
|
||||
};
|
||||
|
||||
export type DatasetItemType = Omit<DatasetSchemaType, 'vectorModel' | 'agentModel'> & {
|
||||
vectorModel: VectorModelItemType;
|
||||
|
@@ -4,11 +4,13 @@ import { PermissionValueType } from './type';
|
||||
|
||||
export type CollaboratorItemType = {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
permission: Permission;
|
||||
name: string;
|
||||
avatar: string;
|
||||
};
|
||||
} & RequireOnlyOne<{
|
||||
tmbId: string;
|
||||
groupId: string;
|
||||
}>;
|
||||
|
||||
export type UpdateClbPermissionProps = {
|
||||
members?: string[];
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { Permission } from './controller';
|
||||
import { PermissionListType } from './type';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
export enum AuthUserTypeEnum {
|
||||
|
5
packages/global/support/permission/type.d.ts
vendored
5
packages/global/support/permission/type.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
import { TeamMemberWithUserSchema } from '../user/team/type';
|
||||
import { AuthUserTypeEnum, PermissionKeyEnum, PerResourceTypeEnum } from './constant';
|
||||
import { MemberGroupSchemaType } from './memberGroup/type';
|
||||
|
||||
// PermissionValueType, the type of permission's value is a number, which is a bit field actually.
|
||||
// It is spired by the permission system in Linux.
|
||||
@@ -33,6 +34,10 @@ export type ResourcePerWithTmbWithUser = Omit<ResourcePermissionType, 'tmbId'> &
|
||||
tmbId: TeamMemberWithUserSchema;
|
||||
};
|
||||
|
||||
export type ResourcePerWithGroup = Omit<ResourcePermissionType, 'groupId'> & {
|
||||
groupId: MemberGroupSchemaType;
|
||||
};
|
||||
|
||||
export type PermissionSchemaType = {
|
||||
defaultPermission: PermissionValueType;
|
||||
inheritPermission: boolean;
|
||||
|
Reference in New Issue
Block a user