mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-25 10:30:25 +08:00
feat: 增加后端权限控制
This commit is contained in:
@@ -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("没有权限"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user