Files
FastGPT/packages/global/support/permission/app/controller.ts
Finley Ge 57e1ef1176 refactor: permission role & app read chat log permission (#5416)
* refactor: permission role

* refactor: permission type

* fix: permission manage

* fix: group owner cannot be deleted

* chore: common per map

* chore: openapi

* chore: rename

* fix: type error

* chore: app chat log permission

* chore: add initv4112
2025-08-11 10:51:44 +08:00

26 lines
804 B
TypeScript

import { type PerConstructPros, Permission } from '../controller';
import { AppDefaultRoleVal, AppPerList, AppRoleList, AppRolePerMap } from './constant';
export class AppPermission extends Permission {
hasReadChatLogPer: boolean = false;
hasReadChatLogRole: boolean = false;
constructor(props?: PerConstructPros) {
if (!props) {
props = {
role: AppDefaultRoleVal
};
} else if (!props?.role) {
props.role = AppDefaultRoleVal;
}
props.roleList = AppRoleList;
props.rolePerMap = AppRolePerMap;
props.perList = AppPerList;
super(props);
this.setUpdatePermissionCallback(() => {
this.hasReadChatLogPer = this.checkPer(AppPerList.readChatLog);
this.hasReadChatLogRole = this.checkRole(AppRoleList.readChatLog.value);
});
}
}