@lcsf/acl
Version:
权限控制模块
84 lines (83 loc) • 1.83 kB
TypeScript
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
export interface LcACLType {
/**
* 角色
*/
role?: string[];
/**
* 用户类型
*/
type?: string[];
/**
* 权限组
*/
permissionGroups?: string[];
/**
* 权限组拼接字符组
*/
permissions?: string[];
/**
* 设置的可以访问的路由菜单
*/
menus?: AuthModelList[];
/**
* 授权可访问的菜单列表
*/
authPaths?: Map<string, string>;
/**
* 待验证的path
*/
authPath?: string;
/**
* 用户自定义的判断字段, 需要同时满足
*/
extraAll?: boolean;
/**
* 用户自定义的判断字段,满足一个即可
*/
extraOne?: boolean;
/**
* Validated against, default: `oneOf`
* - `allOf` the value validates against all the roles or abilities
* - `oneOf` the value validates against exactly one of the roles or abilities
*/
mode?: 'allOf' | 'oneOf';
/**
* 是否取反,即结果为 `true` 时表示未授权
*/
except?: boolean;
[key: string]: NzSafeAny;
}
export declare type LcACLCanType = string | string[] | LcACLType;
export interface LcACLConfig {
/**
* Router URL when guard fail, default: `/auth/403`
*/
guard_url?: string;
}
/**
* 授权的菜单列表单个
*/
export interface AuthPathItem {
icon: string;
id: number;
level: number;
menu_name: string;
parent_id: number;
url: string;
children: null | AuthPathItem[];
}
/**
* 菜单模块列表组
*/
export interface AuthModelList {
menu_list: AuthPathItem[];
model_name: string;
model_id: string;
url: string;
}
export interface MixMenu {
children?: MixMenu[];
menu_list?: MixMenu[];
url: string;
}