mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:24:54 +00:00
* feat: team permission refine (#4402) * chore: team permission extend * feat: manage team permission * chore: api auth * fix: i18n * feat: add initv493 * fix: test, org auth manager * test: app test for refined permission * update init sh * fix: add/remove manage permission (#4427) * fix: add/remove manage permission * fix: github action fastgpt-test * fix: mock create model * fix: team write permission * fix: ts * account permission --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
31 lines
888 B
TypeScript
31 lines
888 B
TypeScript
import { PerConstructPros, Permission } from '../controller';
|
|
import {
|
|
TeamAppCreatePermissionVal,
|
|
TeamDefaultPermissionVal,
|
|
TeamPermissionList
|
|
} from './constant';
|
|
|
|
export class TeamPermission extends Permission {
|
|
hasAppCreatePer: boolean = false;
|
|
hasDatasetCreatePer: boolean = false;
|
|
hasApikeyCreatePer: boolean = false;
|
|
|
|
constructor(props?: PerConstructPros) {
|
|
if (!props) {
|
|
props = {
|
|
per: TeamDefaultPermissionVal
|
|
};
|
|
} else if (!props?.per) {
|
|
props.per = TeamDefaultPermissionVal;
|
|
}
|
|
props.permissionList = TeamPermissionList;
|
|
super(props);
|
|
|
|
this.setUpdatePermissionCallback(() => {
|
|
this.hasAppCreatePer = this.checkPer(TeamAppCreatePermissionVal);
|
|
this.hasDatasetCreatePer = this.checkPer(TeamAppCreatePermissionVal);
|
|
this.hasApikeyCreatePer = this.checkPer(TeamAppCreatePermissionVal);
|
|
});
|
|
}
|
|
}
|