-
Notifications
You must be signed in to change notification settings - Fork 84
/
casbin.go
33 lines (27 loc) · 967 Bytes
/
casbin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package dto
import (
"github.com/gin-gonic/gin"
"github.com/noovertime7/kubemanage/pkg"
)
// CasbinInfo Casbin info structure
type CasbinInfo struct {
Path string `form:"path" json:"path"` // 路径
Method string ` form:"method" json:"method"` // 方法
}
// UpdateCasbinInput 通过角色id更改接口权限
type UpdateCasbinInput struct {
AuthorityId uint `form:"authorityId" json:"authorityId"` // 权限id
CasbinInfo []CasbinInfo `json:"casbinInfos"`
}
// CasbinInReceive Casbin structure for input parameters
type CasbinInReceive struct {
AuthorityId uint `form:"authorityId" json:"authorityId"` // 权限id
}
// BindingValidParams 绑定并校验参数
func (a *CasbinInReceive) BindingValidParams(ctx *gin.Context) error {
return pkg.DefaultGetValidParams(ctx, a)
}
// BindingValidParams 绑定并校验参数
func (a *UpdateCasbinInput) BindingValidParams(ctx *gin.Context) error {
return pkg.DefaultGetValidParams(ctx, a)
}