mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	管理员查询WAF策略时隐藏用户创建的
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
package teaconst
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	Version = "0.0.7"
 | 
			
		||||
	Version = "0.0.7.1"
 | 
			
		||||
 | 
			
		||||
	ProductName   = "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) {
 | 
			
		||||
	return this.Query(tx).
 | 
			
		||||
		State(HTTPFirewallPolicyStateEnabled).
 | 
			
		||||
		Attr("userId", 0).
 | 
			
		||||
		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) {
 | 
			
		||||
	_, err = this.Query(tx).
 | 
			
		||||
		State(HTTPFirewallPolicyStateEnabled).
 | 
			
		||||
		Attr("userId", 0).
 | 
			
		||||
		Offset(offset).
 | 
			
		||||
		Limit(size).
 | 
			
		||||
		DescPk().
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ func IsNotNull(data string) bool {
 | 
			
		||||
func NewQuery(tx *dbs.Tx, dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query {
 | 
			
		||||
	query := dao.Object().Query(tx)
 | 
			
		||||
	if adminId > 0 {
 | 
			
		||||
		query.Attr("adminId", adminId)
 | 
			
		||||
		//query.Attr("adminId", adminId)
 | 
			
		||||
	}
 | 
			
		||||
	if userId > 0 {
 | 
			
		||||
		query.Attr("userId", userId)
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user