UNPKG

@alitajs/antd-plus

Version:

基于 ant-design 封装的偏业务组件

28 lines (22 loc) 618 B
import isArray from 'lodash/isArray'; import isString from 'lodash/isString'; /** * 权限检查方法 * @param { 权限判定 | Permission judgment } authority * @param { 权限验证方法 | no pass components } policy */ var checkAuthority = function checkAuthority(policy, authority) { var result = true; // 数组处理 if (isArray(authority)) { if (!policy.multipleVerify(authority)) { result = false; } } // string 处理 if (isString(authority)) { if (!policy.combinationVerify(authority)) { result = false; } } return result; }; export default checkAuthority;