doc:添加cicd文档模块
This commit is contained in:
18
Yi.Doc.Md/02.框架功能模块教程/13.接口授权.md
Normal file
18
Yi.Doc.Md/02.框架功能模块教程/13.接口授权.md
Normal file
@@ -0,0 +1,18 @@
|
||||
## 简介
|
||||
> 授权必须基于鉴权之后,知道了用户的信息,根据用户权限列表进行判断是否有权限进入
|
||||
|
||||
框架内部集成授权方式,并非为Asp.netcore授权方式,而是提供一种更简单的方式
|
||||
使用起来非常简单
|
||||
|
||||
## 使用
|
||||
只需要在需要授权的接口上打上特性 `[Permission("code")]`接口
|
||||
|
||||
code为登录时候颁发的token中的权限,如果该用户的token 权限列表中不包含code,将被会拦截,并提示未授权,被拒绝
|
||||
|
||||
``` cs
|
||||
[Permission("system:user:delete")]
|
||||
public override async Task DeleteAsync(Guid id)
|
||||
{
|
||||
await base.DeleteAsync(id);
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user