基本资源文件

This commit is contained in:
hello 2024-04-04 06:28:27 +08:00
parent afd2c68fbf
commit 1ea49c4514

View File

@ -1,10 +1,10 @@
# 基于资源授权的最佳实践 # 基于资源授权的最佳实践
## 在 Identity Service 中提供权限检查接口 ## 在 Identity Service 中提供权限检查接口
```csharp ```csharp
[HttpHead] [HttpHead]
public async Task<ActionResult<IEnumerable<PermissionGrantedResponse>>> CheckPermission(string permissionName, string? resourceType = null, string? resourceId = null public async Task<IActionResult> CheckPermission(string permissionName, string? resourceType = null, string? resourceId = null
{ {
if (await permissionChecker.IsGrantedAsync(permissionName, resourceType, resourceId)) if (await permissionChecker.IsGrantedAsync(permissionName, resourceType, resourceId))
{ {