Files
timi-web/src/types/Role.ts
T
2026-08-11 12:02:38 +08:00

42 lines
1.0 KiB
TypeScript

import type { AuthOwnerType, ModuleCode, Permission } from "./Permission";
import { Model } from "./Model";
export type Role = {
moduleCode: ModuleCode;
code: string;
nameLangId?: string;
name?: string;
description?: string;
builtin?: boolean;
protectedRole?: boolean;
parentRoleId?: string;
ownerType?: AuthOwnerType;
ownerId?: string;
createdBy?: string;
permissionList?: Permission[];
allPermissionList?: Permission[];
childRoleList?: Role[];
parentRole?: Role;
delegationPermissionList?: Permission[];
permissionIdList?: string[];
childRoleIdList?: string[];
delegationPermissionIdList?: string[];
} & Model;
export type RolePayload = Partial<Pick<Role, "moduleCode" | "code" | "nameLangId" | "name" | "description">> & {
id?: string;
parentRoleId?: string;
ownerType?: AuthOwnerType;
ownerId?: string;
permissionIdList?: string[];
childRoleIdList?: string[];
delegationPermissionIdList?: string[];
};
export interface AuthorizeUserRole {
userId: string;
moduleCode?: ModuleCode;
roleIdList?: string[];
}