63 lines
1.5 KiB
TypeScript
63 lines
1.5 KiB
TypeScript
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;
|
|
};
|