refactor permission
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import type { AuthOwnerType, ModuleCode, Permission as UserPermission, Role as UserRole } from "timi-web";
|
||||
|
||||
export type Permission = UserPermission & {
|
||||
builtin?: boolean;
|
||||
protectedPermission?: boolean;
|
||||
ownerType?: AuthOwnerType;
|
||||
ownerId?: string;
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
export type Role = Omit<
|
||||
UserRole,
|
||||
"id" | "permissionIdList" | "childRoleIdList" | "delegationPermissionIdList" | "delegationPermissionList"
|
||||
> & {
|
||||
id: string;
|
||||
permissionIdList: string[];
|
||||
childRoleIdList: string[];
|
||||
delegationPermissionIdList: string[];
|
||||
builtin?: boolean;
|
||||
protectedRole?: boolean;
|
||||
ownerType?: AuthOwnerType;
|
||||
ownerId?: string;
|
||||
createdBy?: string;
|
||||
permissionList?: Permission[];
|
||||
allPermissionList?: Permission[];
|
||||
childRoleList?: UserRole[];
|
||||
parentRole?: UserRole;
|
||||
delegationPermissionList?: Permission[];
|
||||
};
|
||||
|
||||
export type RoleDraft = {
|
||||
id?: string;
|
||||
code: string;
|
||||
name: string;
|
||||
description: string;
|
||||
nameLangId?: string;
|
||||
moduleCode?: ModuleCode;
|
||||
parentRoleId?: string;
|
||||
ownerType?: AuthOwnerType;
|
||||
ownerId?: string;
|
||||
permissionIdList?: string[];
|
||||
childRoleIdList?: string[];
|
||||
delegationPermissionIdList?: string[];
|
||||
};
|
||||
|
||||
export type RolePayload = Partial<Pick<Role, "moduleCode" | "code" | "nameLangId" | "name" | "description">> & {
|
||||
id?: string;
|
||||
parentRoleId?: string;
|
||||
ownerType?: AuthOwnerType;
|
||||
ownerId?: string;
|
||||
permissionIdList?: string[];
|
||||
childRoleIdList?: string[];
|
||||
};
|
||||
|
||||
export type PermissionDraft = {
|
||||
id?: string;
|
||||
code: string;
|
||||
name: string;
|
||||
description: string;
|
||||
nameLangId?: string;
|
||||
moduleCode?: ModuleCode;
|
||||
};
|
||||
Reference in New Issue
Block a user