mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-11 22:00:27 +08:00
管理员查询WAF策略时隐藏用户创建的
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package teaconst
|
package teaconst
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "0.0.7"
|
Version = "0.0.7.1"
|
||||||
|
|
||||||
ProductName = "Edge API"
|
ProductName = "Edge API"
|
||||||
ProcessName = "edge-api"
|
ProcessName = "edge-api"
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicy(tx *dbs.Tx, policyId int
|
|||||||
func (this *HTTPFirewallPolicyDAO) CountAllEnabledFirewallPolicies(tx *dbs.Tx) (int64, error) {
|
func (this *HTTPFirewallPolicyDAO) CountAllEnabledFirewallPolicies(tx *dbs.Tx) (int64, error) {
|
||||||
return this.Query(tx).
|
return this.Query(tx).
|
||||||
State(HTTPFirewallPolicyStateEnabled).
|
State(HTTPFirewallPolicyStateEnabled).
|
||||||
|
Attr("userId", 0).
|
||||||
Count()
|
Count()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,6 +192,7 @@ func (this *HTTPFirewallPolicyDAO) CountAllEnabledFirewallPolicies(tx *dbs.Tx) (
|
|||||||
func (this *HTTPFirewallPolicyDAO) ListEnabledFirewallPolicies(tx *dbs.Tx, offset int64, size int64) (result []*HTTPFirewallPolicy, err error) {
|
func (this *HTTPFirewallPolicyDAO) ListEnabledFirewallPolicies(tx *dbs.Tx, offset int64, size int64) (result []*HTTPFirewallPolicy, err error) {
|
||||||
_, err = this.Query(tx).
|
_, err = this.Query(tx).
|
||||||
State(HTTPFirewallPolicyStateEnabled).
|
State(HTTPFirewallPolicyStateEnabled).
|
||||||
|
Attr("userId", 0).
|
||||||
Offset(offset).
|
Offset(offset).
|
||||||
Limit(size).
|
Limit(size).
|
||||||
DescPk().
|
DescPk().
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func IsNotNull(data string) bool {
|
|||||||
func NewQuery(tx *dbs.Tx, dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query {
|
func NewQuery(tx *dbs.Tx, dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query {
|
||||||
query := dao.Object().Query(tx)
|
query := dao.Object().Query(tx)
|
||||||
if adminId > 0 {
|
if adminId > 0 {
|
||||||
query.Attr("adminId", adminId)
|
//query.Attr("adminId", adminId)
|
||||||
}
|
}
|
||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
query.Attr("userId", userId)
|
query.Attr("userId", userId)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user