mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
Permission (#1687)
Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
20
packages/global/support/permission/app/constant.ts
Normal file
20
packages/global/support/permission/app/constant.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { NullPermission, PermissionKeyEnum, PermissionList } from '../constant';
|
||||
import { PermissionListType } from '../type';
|
||||
|
||||
export enum AppPermissionKeyEnum {}
|
||||
export const AppPermissionList: PermissionListType = {
|
||||
[PermissionKeyEnum.read]: {
|
||||
...PermissionList[PermissionKeyEnum.read],
|
||||
description: '可使用该应用进行对话'
|
||||
},
|
||||
[PermissionKeyEnum.write]: {
|
||||
...PermissionList[PermissionKeyEnum.write],
|
||||
description: '可查看和编辑应用'
|
||||
},
|
||||
[PermissionKeyEnum.manage]: {
|
||||
...PermissionList[PermissionKeyEnum.manage],
|
||||
description: '写权限基础上,可配置发布渠道、查看对话日志、分配该应用权限'
|
||||
}
|
||||
};
|
||||
|
||||
export const AppDefaultPermission = NullPermission;
|
15
packages/global/support/permission/app/controller.ts
Normal file
15
packages/global/support/permission/app/controller.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { PerConstructPros, Permission } from '../controller';
|
||||
import { AppDefaultPermission } from './constant';
|
||||
|
||||
export class AppPermission extends Permission {
|
||||
constructor(props?: PerConstructPros) {
|
||||
if (!props) {
|
||||
props = {
|
||||
per: AppDefaultPermission
|
||||
};
|
||||
} else if (!props?.per) {
|
||||
props.per = AppDefaultPermission;
|
||||
}
|
||||
super(props);
|
||||
}
|
||||
}
|
0
packages/global/support/permission/app/type.d.ts
vendored
Normal file
0
packages/global/support/permission/app/type.d.ts
vendored
Normal file
Reference in New Issue
Block a user