在actions中添加权限
This commit is contained in:
1 parent
abc8b271c4
commit
b646ce9335
1 file changed
+1
@@ -34,6 +34,7 @@ func IndexAction(m model.ActiveRecord, d dto.Dtor) gin.HandlerFunc {
|
||||
err = req.Validate()
|
||||
tools.HasError(err, "参数验证失败", 422)
|
||||
p, err := newDataPermission(db, tools.GetUserId(c))
|
||||
tools.HasError(err, "权限范围鉴定错误", 500)
|
||||
err = db.WithContext(c).Model(object).
|
||||
Scopes(
|
||||
tools.MakeCondition(req.GetNeedSearch()),
|
||||
|
||||
Reference in new issue
Block a user