feat: 增加后端权限控制

This commit is contained in:
meilin.huang
2021-06-09 16:58:57 +08:00
parent 9074e7637e
commit 3ebc3ee14d
39 changed files with 4463 additions and 3913 deletions

View File

@@ -63,7 +63,8 @@ func (m *Machine) WsSSH(g *gin.Context) {
panic(biz.NewBizErr("升级websocket失败"))
}
// 权限校验
if err = ctx.PermissionHandler(ctx.NewReqCtxWithGin(g)); err != nil {
rc := ctx.NewReqCtxWithGin(g).WithRequiredPermission(ctx.NewPermission("machine:terminal"))
if err = ctx.PermissionHandler(rc); err != nil {
panic(biz.NewBizErr("没有权限"))
}