HuanMengAdmin/admin-server/MiaoYu.Api.Admin/wwwroot/docs/guide/hzy-admin/permission/data.html
2024-07-18 02:27:50 +08:00

40 lines
23 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.62">
<style>
:root {
--c-bg: #fff;
}
html.dark {
--c-bg: #22272e;
}
html, body {
background-color: var(--c-bg);
}
</style>
<script>
const userMode = localStorage.getItem('vuepress-color-scheme');
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
document.documentElement.classList.toggle('dark', true);
}
</script>
<link rel="icon" href="/favicon.jpg"><title>数据权限 | 您好, 欢迎查看 MiaoYu 文档 </title><meta name="description" content="MiaoYu 开源项目文档网站!">
<link rel="preload" href="/docs/assets/style-961b9d5d.css" as="style"><link rel="stylesheet" href="/docs/assets/style-961b9d5d.css">
<link rel="modulepreload" href="/docs/assets/app-4f4af2d5.js"><link rel="modulepreload" href="/docs/assets/data.html-578c517a.js"><link rel="modulepreload" href="/docs/assets/data.html-0f889ade.js"><link rel="prefetch" href="/docs/assets/index.html-28072875.js" as="script"><link rel="prefetch" href="/docs/assets/code-gen.html-4397c299.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-3fb3b3b2.js" as="script"><link rel="prefetch" href="/docs/assets/ioc-aop.html-0144cd72.js" as="script"><link rel="prefetch" href="/docs/assets/scheduled-tasks.html-bedcb769.js" as="script"><link rel="prefetch" href="/docs/assets/user-info.html-8578df40.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-013ddfd3.js" as="script"><link rel="prefetch" href="/docs/assets/dbs.html-9052a8ef.js" as="script"><link rel="prefetch" href="/docs/assets/efcore.html-ec28f7d0.js" as="script"><link rel="prefetch" href="/docs/assets/sql.html-fe3eac11.js" as="script"><link rel="prefetch" href="/docs/assets/work.html-fe7c2daa.js" as="script"><link rel="prefetch" href="/docs/assets/simple.html-54212753.js" as="script"><link rel="prefetch" href="/docs/assets/split.html-e759ef21.js" as="script"><link rel="prefetch" href="/docs/assets/client.html-f2da1493.js" as="script"><link rel="prefetch" href="/docs/assets/download.html-903adac5.js" as="script"><link rel="prefetch" href="/docs/assets/problem.html-1c845052.js" as="script"><link rel="prefetch" href="/docs/assets/api.html-caba109f.js" as="script"><link rel="prefetch" href="/docs/assets/authorize.html-37a2ba6f.js" as="script"><link rel="prefetch" href="/docs/assets/api-check-model.html-b5cf845e.js" as="script"><link rel="prefetch" href="/docs/assets/api-resource-cache.html-f627996b.js" as="script"><link rel="prefetch" href="/docs/assets/api-result.html-f90b60b9.js" as="script"><link rel="prefetch" href="/docs/assets/request-limit.html-79d7eb18.js" as="script"><link rel="prefetch" href="/docs/assets/404.html-f9875e7b.js" as="script"><link rel="prefetch" href="/docs/assets/index.html-f24f1c0d.js" as="script"><link rel="prefetch" href="/docs/assets/code-gen.html-9aef4a31.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-287156bf.js" as="script"><link rel="prefetch" href="/docs/assets/ioc-aop.html-c387c913.js" as="script"><link rel="prefetch" href="/docs/assets/scheduled-tasks.html-b338f70f.js" as="script"><link rel="prefetch" href="/docs/assets/user-info.html-8f482e6a.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-7cba3ecd.js" as="script"><link rel="prefetch" href="/docs/assets/dbs.html-4250b788.js" as="script"><link rel="prefetch" href="/docs/assets/efcore.html-c2834bdb.js" as="script"><link rel="prefetch" href="/docs/assets/sql.html-e0d45a22.js" as="script"><link rel="prefetch" href="/docs/assets/work.html-6d0ca231.js" as="script"><link rel="prefetch" href="/docs/assets/simple.html-80586b86.js" as="script"><link rel="prefetch" href="/docs/assets/split.html-7a328015.js" as="script"><link rel="prefetch" href="/docs/assets/client.html-0c7bcd45.js" as="script"><link rel="prefetch" href="/docs/assets/download.html-27f039c3.js" as="script"><link rel="prefetch" href="/docs/assets/problem.html-9ef68938.js" as="script"><link rel="prefetch" href="/docs/assets/api.html-8c3a828a.js" as="script"><link rel="prefetch" href="/docs/assets/authorize.html-be0e89f8.js" as="script"><link rel="prefetch" href="/docs/assets/api-check-model.html-8aaab178.js" as="script"><link rel="prefetch" href="/docs/assets/api-resource-cache.html-465cb7e9.js" as="script"><link rel="prefetch" href="/docs/assets/api-result.html-f2682747.js" as="script"><link rel="prefetch" href="/docs/assets/request-limit.html-c85ce0aa.js" as="script"><link rel="prefetch" href="/docs/assets/404.html-ee2a0c1c.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/docs/" class=""><!----><span class="site-name">您好, 欢迎查看 MiaoYu 文档 </span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a class="external-link" href="https://www.bilibili.com/video/BV1tt4y157qH/" rel="noopener noreferrer" target="_blank" aria-label="视频讲解"><!--[--><!--]--> 视频讲解 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/docs/guide/others/home.md" class="" aria-label="其他项目"><!--[--><!--]--> 其他项目 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="http://124.221.128.7:5600/" rel="noopener noreferrer" target="_blank" aria-label="HzyAdmin 预览"><!--[--><!--]--> HzyAdmin 预览 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://gitee.com/hzy6" rel="noopener noreferrer" target="_blank" aria-label="gitee"><!--[--><!--]--> gitee <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/hzy-6" rel="noopener noreferrer" target="_blank" aria-label="github"><!--[--><!--]--> github <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="toggle color mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a class="external-link" href="https://www.bilibili.com/video/BV1tt4y157qH/" rel="noopener noreferrer" target="_blank" aria-label="视频讲解"><!--[--><!--]--> 视频讲解 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/docs/guide/others/home.md" class="" aria-label="其他项目"><!--[--><!--]--> 其他项目 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="http://124.221.128.7:5600/" rel="noopener noreferrer" target="_blank" aria-label="HzyAdmin 预览"><!--[--><!--]--> HzyAdmin 预览 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://gitee.com/hzy6" rel="noopener noreferrer" target="_blank" aria-label="gitee"><!--[--><!--]--> gitee <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/hzy-6" rel="noopener noreferrer" target="_blank" aria-label="github"><!--[--><!--]--> github <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><a href="/docs/guide/hzy-admin/home.md" class="sidebar-item sidebar-heading active collapsible" aria-label="HzyAdmin"><!--[--><!--]--> HzyAdmin <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/home.md" class="sidebar-item" aria-label="欢迎使用"><!--[--><!--]--> 欢迎使用 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/user-info.md" class="sidebar-item" aria-label="获取登陆人信息"><!--[--><!--]--> 获取登陆人信息 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/scheduled-tasks.md" class="sidebar-item" aria-label="定时任务"><!--[--><!--]--> 定时任务 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/code-gen.md" class="sidebar-item" aria-label="代码生成"><!--[--><!--]--> 代码生成 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/ioc-aop.md" class="sidebar-item" aria-label="自动 IOC 注入 和 AOP"><!--[--><!--]--> 自动 IOC 注入 和 AOP <!--[--><!--]--></a><!----></li><li><p tabindex="0" class="sidebar-item collapsible">数据库 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/database/efcore.md" class="sidebar-item" aria-label="EFCore 初始化数据库"><!--[--><!--]--> EFCore 初始化数据库 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/sql.md" class="sidebar-item" aria-label="SQL 初始化数据库"><!--[--><!--]--> SQL 初始化数据库 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/dbs.md" class="sidebar-item" aria-label="多数据源"><!--[--><!--]--> 多数据源 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/work.md" class="sidebar-item" aria-label="事务,延迟提交"><!--[--><!--]--> 事务,延迟提交 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">部署 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/deployment/split.md" class="sidebar-item" aria-label="前后端分离部署"><!--[--><!--]--> 前后端分离部署 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/deployment/simple.md" class="sidebar-item" aria-label="整体部署"><!--[--><!--]--> 整体部署 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item active collapsible">权限 <span class="down arrow"></span></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/permission/authorize.md" class="sidebar-item" aria-label="授权验证"><!--[--><!--]--> 授权验证 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/permission/data.md" class="sidebar-item active" aria-label="数据权限"><!--[--><!--]--> 数据权限 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/permission/api.md" class="sidebar-item" aria-label="接口权限"><!--[--><!--]--> 接口权限 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">WebApi <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/web-api/api-check-model.md" class="sidebar-item" aria-label="模型验证"><!--[--><!--]--> 模型验证 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/api-result.md" class="sidebar-item" aria-label="统一返回"><!--[--><!--]--> 统一返回 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/api-resource-cache.md" class="sidebar-item" aria-label="缓存特性"><!--[--><!--]--> 缓存特性 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/request-limit.md" class="sidebar-item" aria-label="限流特性"><!--[--><!--]--> 限流特性 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">其他 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/others/client.md" class="sidebar-item" aria-label="前端运行及说明"><!--[--><!--]--> 前端运行及说明 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/others/download.md" class="sidebar-item" aria-label="前端下载文件"><!--[--><!--]--> 前端下载文件 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/others/problem.md" class="sidebar-item" aria-label="更多问题"><!--[--><!--]--> 更多问题 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">其他项目 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/others/home.md" class="sidebar-item" aria-label="介绍"><!--[--><!--]--> 介绍 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><!--]--><div><h1 id="数据权限" tabindex="-1"><a class="header-anchor" href="#数据权限" aria-hidden="true">#</a> 数据权限</h1><p><img src="/docs/hzy-admin/permission/data-1.jpg" alt="数据权限"></p><h2 id="_1、数据权限方式一" tabindex="-1"><a class="header-anchor" href="#_1、数据权限方式一" aria-hidden="true">#</a> 1、数据权限方式一</h2><blockquote><p>此方式适合多表查询时筛选。</p></blockquote><div class="custom-container tip"><p class="custom-container-title">我们需要关心以下几点</p><p>1、界面角色管理 点击数据权限,配置好对应角色需要的数据权限</p><p>2、编写linq组合查询时需要 select new { _CreatorUserId = w.CreatorUserId ,_OrganizationId = w.OrganizationId } 返回 数据所属人的 CreatorUserId ,和数据所属组织的 OrganizationId</p><p>3、通过 awaitthis._defaultRepository.AsPagingViewAsync(query, page, size, null, accountInfo, w=&gt;w._CreatorUserId, w=&gt;w._OrganizationId); 依次函数传入 参数5、 参数6、 参数7 即可实现权限筛选</p></div><p><img src="/docs/hzy-admin/permission/data-2.jpg" alt="数据权限方式一"></p><h2 id="_2、数据权限方式二" tabindex="-1"><a class="header-anchor" href="#_2、数据权限方式二" aria-hidden="true">#</a> 2、数据权限方式二</h2><blockquote><p>此方式适合单表查询时筛选CreatorUserId、CreationTime这两个字段是不需要自己手动填充在插入数据时自动填充</p></blockquote><div class="custom-container tip"><p class="custom-container-title">这里举例有一个 Member 表 需要注意一下几点</p><p>1、界面角色管理 点击数据权限,配置好对应角色需要的数据权限</p><p><code>2、创建 Memeber 实体需要继承 CreateBaseEntity&lt;TKey&gt; 创建相关的父类 并且Member数据库表必须要有 CreatorUserId、CreationTime</code></p><p><code>3、我们可以在查询时调用 _defaultRepository.DataPermission(accountInfo,_sysUserRepository);</code></p><pre><code>入参1当前登录用户信息 可实现结果得筛选
入参2_sysUserRepository用户仓储注入
</code></pre></div><div class="custom-container warning"><p class="custom-container-title">参数入口</p><div class="language-csharp line-numbers-mode" data-ext="cs"><pre class="language-csharp"><code>
<span class="token return-type class-name">IQueryable<span class="token punctuation">&lt;</span>TModel<span class="token punctuation">&gt;</span></span> <span class="token generic-method"><span class="token function">DataPermission</span><span class="token generic class-name"><span class="token punctuation">&lt;</span>TModel<span class="token punctuation">&gt;</span></span></span><span class="token punctuation">(</span><span class="token class-name">IQueryable<span class="token punctuation">&lt;</span>TModel<span class="token punctuation">&gt;</span></span> query<span class="token punctuation">,</span> <span class="token class-name">AccountInfo</span> accountInfo<span class="token punctuation">,</span> <span class="token class-name">Expression<span class="token punctuation">&lt;</span>Func<span class="token punctuation">&lt;</span>TModel<span class="token punctuation">,</span> <span class="token keyword">object</span><span class="token punctuation">&gt;</span><span class="token punctuation">&gt;</span></span> userIdFieldNameExpression <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">,</span> <span class="token class-name">Expression<span class="token punctuation">&lt;</span>Func<span class="token punctuation">&lt;</span>TModel<span class="token punctuation">,</span> <span class="token keyword">object</span><span class="token punctuation">&gt;</span><span class="token punctuation">&gt;</span></span> organizationIdFieldNameExpression <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>query查询表达式</p><p>accountInfo当前登录用户信息</p><p>userIdFieldNameExpression数据创建者Id</p><p>organizationIdFieldNameExpression数据创建者所属组织Id</p></div></div><!--[--><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: 1396510655@qq.com">hzy</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/docs/assets/app-4f4af2d5.js" defer></script>
</body>
</html>