mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 16:00:24 +08:00 
			
		
		
		
	优化接口权限
This commit is contained in:
		@@ -15,7 +15,7 @@ type ACMEProviderService struct {
 | 
			
		||||
 | 
			
		||||
// FindAllACMEProviders 查找所有的服务商
 | 
			
		||||
func (this *ACMEProviderService) FindAllACMEProviders(ctx context.Context, req *pb.FindAllACMEProvidersRequest) (*pb.FindAllACMEProvidersResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -37,7 +37,7 @@ func (this *ACMEProviderService) FindAllACMEProviders(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// FindACMEProviderWithCode 根据代号查找服务商
 | 
			
		||||
func (this *ACMEProviderService) FindACMEProviderWithCode(ctx context.Context, req *pb.FindACMEProviderWithCodeRequest) (*pb.FindACMEProviderWithCodeResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type ACMEProviderAccountService struct {
 | 
			
		||||
 | 
			
		||||
// CreateACMEProviderAccount 创建服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) CreateACMEProviderAccount(ctx context.Context, req *pb.CreateACMEProviderAccountRequest) (*pb.CreateACMEProviderAccountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -33,7 +33,7 @@ func (this *ACMEProviderAccountService) CreateACMEProviderAccount(ctx context.Co
 | 
			
		||||
 | 
			
		||||
// FindAllACMEProviderAccountsWithProviderCode 使用代号查找服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) FindAllACMEProviderAccountsWithProviderCode(ctx context.Context, req *pb.FindAllACMEProviderAccountsWithProviderCodeRequest) (*pb.FindAllACMEProviderAccountsWithProviderCodeResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -76,7 +76,7 @@ func (this *ACMEProviderAccountService) FindAllACMEProviderAccountsWithProviderC
 | 
			
		||||
 | 
			
		||||
// UpdateACMEProviderAccount 修改服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) UpdateACMEProviderAccount(ctx context.Context, req *pb.UpdateACMEProviderAccountRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -100,7 +100,7 @@ func (this *ACMEProviderAccountService) UpdateACMEProviderAccount(ctx context.Co
 | 
			
		||||
 | 
			
		||||
// DeleteACMEProviderAccount 删除服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) DeleteACMEProviderAccount(ctx context.Context, req *pb.DeleteACMEProviderAccountRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -124,7 +124,7 @@ func (this *ACMEProviderAccountService) DeleteACMEProviderAccount(ctx context.Co
 | 
			
		||||
 | 
			
		||||
// FindEnabledACMEProviderAccount 查找单个服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) FindEnabledACMEProviderAccount(ctx context.Context, req *pb.FindEnabledACMEProviderAccountRequest) (*pb.FindEnabledACMEProviderAccountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -174,7 +174,7 @@ func (this *ACMEProviderAccountService) FindEnabledACMEProviderAccount(ctx conte
 | 
			
		||||
 | 
			
		||||
// CountAllEnabledACMEProviderAccounts 计算所有服务商账号数量
 | 
			
		||||
func (this *ACMEProviderAccountService) CountAllEnabledACMEProviderAccounts(ctx context.Context, req *pb.CountAllEnabledACMEProviderAccountsRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -189,7 +189,7 @@ func (this *ACMEProviderAccountService) CountAllEnabledACMEProviderAccounts(ctx
 | 
			
		||||
 | 
			
		||||
// ListEnabledACMEProviderAccounts 列出单页服务商账号
 | 
			
		||||
func (this *ACMEProviderAccountService) ListEnabledACMEProviderAccounts(ctx context.Context, req *pb.ListEnabledACMEProviderAccountsRequest) (*pb.ListEnabledACMEProviderAccountsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type ACMETaskService struct {
 | 
			
		||||
 | 
			
		||||
// CountAllEnabledACMETasksWithACMEUserId 计算某个ACME用户相关的任务数量
 | 
			
		||||
func (this *ACMETaskService) CountAllEnabledACMETasksWithACMEUserId(ctx context.Context, req *pb.CountAllEnabledACMETasksWithACMEUserIdRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -37,7 +37,7 @@ func (this *ACMETaskService) CountAllEnabledACMETasksWithACMEUserId(ctx context.
 | 
			
		||||
 | 
			
		||||
// CountEnabledACMETasksWithDNSProviderId 计算跟某个DNS服务商相关的任务数量
 | 
			
		||||
func (this *ACMETaskService) CountEnabledACMETasksWithDNSProviderId(ctx context.Context, req *pb.CountEnabledACMETasksWithDNSProviderIdRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -55,7 +55,7 @@ func (this *ACMETaskService) CountEnabledACMETasksWithDNSProviderId(ctx context.
 | 
			
		||||
 | 
			
		||||
// CountAllEnabledACMETasks 计算所有任务数量
 | 
			
		||||
func (this *ACMETaskService) CountAllEnabledACMETasks(ctx context.Context, req *pb.CountAllEnabledACMETasksRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -74,7 +74,7 @@ func (this *ACMETaskService) CountAllEnabledACMETasks(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// ListEnabledACMETasks 列出单页任务
 | 
			
		||||
func (this *ACMETaskService) ListEnabledACMETasks(ctx context.Context, req *pb.ListEnabledACMETasksRequest) (*pb.ListEnabledACMETasksResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -223,7 +223,7 @@ func (this *ACMETaskService) ListEnabledACMETasks(ctx context.Context, req *pb.L
 | 
			
		||||
 | 
			
		||||
// CreateACMETask 创建任务
 | 
			
		||||
func (this *ACMETaskService) CreateACMETask(ctx context.Context, req *pb.CreateACMETaskRequest) (*pb.CreateACMETaskResponse, error) {
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -242,7 +242,7 @@ func (this *ACMETaskService) CreateACMETask(ctx context.Context, req *pb.CreateA
 | 
			
		||||
 | 
			
		||||
// UpdateACMETask 修改任务
 | 
			
		||||
func (this *ACMETaskService) UpdateACMETask(ctx context.Context, req *pb.UpdateACMETaskRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -266,7 +266,7 @@ func (this *ACMETaskService) UpdateACMETask(ctx context.Context, req *pb.UpdateA
 | 
			
		||||
 | 
			
		||||
// DeleteACMETask 删除任务
 | 
			
		||||
func (this *ACMETaskService) DeleteACMETask(ctx context.Context, req *pb.DeleteACMETaskRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -290,7 +290,7 @@ func (this *ACMETaskService) DeleteACMETask(ctx context.Context, req *pb.DeleteA
 | 
			
		||||
 | 
			
		||||
// RunACMETask 运行某个任务
 | 
			
		||||
func (this *ACMETaskService) RunACMETask(ctx context.Context, req *pb.RunACMETaskRequest) (*pb.RunACMETaskResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -316,7 +316,7 @@ func (this *ACMETaskService) RunACMETask(ctx context.Context, req *pb.RunACMETas
 | 
			
		||||
 | 
			
		||||
// FindEnabledACMETask 查找单个任务信息
 | 
			
		||||
func (this *ACMETaskService) FindEnabledACMETask(ctx context.Context, req *pb.FindEnabledACMETaskRequest) (*pb.FindEnabledACMETaskResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ACMEUserService struct {
 | 
			
		||||
// CreateACMEUser 创建用户
 | 
			
		||||
func (this *ACMEUserService) CreateACMEUser(ctx context.Context, req *pb.CreateACMEUserRequest) (*pb.CreateACMEUserResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -32,7 +32,7 @@ func (this *ACMEUserService) CreateACMEUser(ctx context.Context, req *pb.CreateA
 | 
			
		||||
// UpdateACMEUser 修改用户
 | 
			
		||||
func (this *ACMEUserService) UpdateACMEUser(ctx context.Context, req *pb.UpdateACMEUserRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -58,7 +58,7 @@ func (this *ACMEUserService) UpdateACMEUser(ctx context.Context, req *pb.UpdateA
 | 
			
		||||
// DeleteACMEUser 删除用户
 | 
			
		||||
func (this *ACMEUserService) DeleteACMEUser(ctx context.Context, req *pb.DeleteACMEUserRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -84,7 +84,7 @@ func (this *ACMEUserService) DeleteACMEUser(ctx context.Context, req *pb.DeleteA
 | 
			
		||||
// CountACMEUsers 计算用户数量
 | 
			
		||||
func (this *ACMEUserService) CountACMEUsers(ctx context.Context, req *pb.CountAcmeUsersRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -104,7 +104,7 @@ func (this *ACMEUserService) CountACMEUsers(ctx context.Context, req *pb.CountAc
 | 
			
		||||
// ListACMEUsers 列出单页用户
 | 
			
		||||
func (this *ACMEUserService) ListACMEUsers(ctx context.Context, req *pb.ListACMEUsersRequest) (*pb.ListACMEUsersResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -180,7 +180,7 @@ func (this *ACMEUserService) ListACMEUsers(ctx context.Context, req *pb.ListACME
 | 
			
		||||
// FindEnabledACMEUser 查找单个用户
 | 
			
		||||
func (this *ACMEUserService) FindEnabledACMEUser(ctx context.Context, req *pb.FindEnabledACMEUserRequest) (*pb.FindEnabledACMEUserResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -260,7 +260,7 @@ func (this *ACMEUserService) FindEnabledACMEUser(ctx context.Context, req *pb.Fi
 | 
			
		||||
// FindAllACMEUsers 查找所有用户
 | 
			
		||||
func (this *ACMEUserService) FindAllACMEUsers(ctx context.Context, req *pb.FindAllACMEUsersRequest) (*pb.FindAllACMEUsersResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -184,7 +184,7 @@ func (this *APINodeService) ListEnabledAPINodes(ctx context.Context, req *pb.Lis
 | 
			
		||||
 | 
			
		||||
// FindEnabledAPINode 根据ID查找节点
 | 
			
		||||
func (this *APINodeService) FindEnabledAPINode(ctx context.Context, req *pb.FindEnabledAPINodeRequest) (*pb.FindEnabledAPINodeResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ func (this *BaseService) ValidateAdmin(ctx context.Context) (adminId int64, err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ValidateAdminAndUser 校验管理员和用户
 | 
			
		||||
func (this *BaseService) ValidateAdminAndUser(ctx context.Context) (adminId int64, userId int64, err error) {
 | 
			
		||||
func (this *BaseService) ValidateAdminAndUser(ctx context.Context, canRest bool) (adminId int64, userId int64, err error) {
 | 
			
		||||
	reqUserType, _, reqUserId, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin, rpcutils.UserTypeUser)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
@@ -57,6 +57,15 @@ func (this *BaseService) ValidateAdminAndUser(ctx context.Context) (adminId int6
 | 
			
		||||
		err = errors.New("invalid user type")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if userId > 0 && !canRest && rpcutils.IsRest(ctx) {
 | 
			
		||||
		err = errors.New("can not be called by rest")
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -73,7 +82,13 @@ func (this *BaseService) ValidateNSNode(ctx context.Context) (nodeId int64, err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ValidateUserNode 校验用户节点
 | 
			
		||||
func (this *BaseService) ValidateUserNode(ctx context.Context) (userId int64, err error) {
 | 
			
		||||
func (this *BaseService) ValidateUserNode(ctx context.Context, canRest bool) (userId int64, err error) {
 | 
			
		||||
	// 不允许REST调用
 | 
			
		||||
	if !canRest && rpcutils.IsRest(ctx) {
 | 
			
		||||
		err = errors.New("can not be called by rest")
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, userId, err = rpcutils.ValidateRequest(ctx, rpcutils.UserTypeUser)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ type DNSDomainService struct {
 | 
			
		||||
// CreateDNSDomain 创建域名
 | 
			
		||||
func (this *DNSDomainService) CreateDNSDomain(ctx context.Context, req *pb.CreateDNSDomainRequest) (*pb.CreateDNSDomainResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -766,7 +766,7 @@ func (this *DNSDomainService) syncClusterDNS(req *pb.SyncDNSDomainDataRequest) (
 | 
			
		||||
 | 
			
		||||
// ExistDNSDomainRecord 检查域名是否在记录中
 | 
			
		||||
func (this *DNSDomainService) ExistDNSDomainRecord(ctx context.Context, req *pb.ExistDNSDomainRecordRequest) (*pb.ExistDNSDomainRecordResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -782,7 +782,7 @@ func (this *DNSDomainService) ExistDNSDomainRecord(ctx context.Context, req *pb.
 | 
			
		||||
 | 
			
		||||
// SyncDNSDomainsFromProvider 从服务商同步域名
 | 
			
		||||
func (this *DNSDomainService) SyncDNSDomainsFromProvider(ctx context.Context, req *pb.SyncDNSDomainsFromProviderRequest) (*pb.SyncDNSDomainsFromProviderResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type DNSProviderService struct {
 | 
			
		||||
// CreateDNSProvider 创建服务商
 | 
			
		||||
func (this *DNSProviderService) CreateDNSProvider(ctx context.Context, req *pb.CreateDNSProviderRequest) (*pb.CreateDNSProviderResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -33,7 +33,7 @@ func (this *DNSProviderService) CreateDNSProvider(ctx context.Context, req *pb.C
 | 
			
		||||
// UpdateDNSProvider 修改服务商
 | 
			
		||||
func (this *DNSProviderService) UpdateDNSProvider(ctx context.Context, req *pb.UpdateDNSProviderRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -52,7 +52,7 @@ func (this *DNSProviderService) UpdateDNSProvider(ctx context.Context, req *pb.U
 | 
			
		||||
// CountAllEnabledDNSProviders 计算服务商数量
 | 
			
		||||
func (this *DNSProviderService) CountAllEnabledDNSProviders(ctx context.Context, req *pb.CountAllEnabledDNSProvidersRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -72,7 +72,7 @@ func (this *DNSProviderService) CountAllEnabledDNSProviders(ctx context.Context,
 | 
			
		||||
// ListEnabledDNSProviders 列出单页服务商信息
 | 
			
		||||
func (this *DNSProviderService) ListEnabledDNSProviders(ctx context.Context, req *pb.ListEnabledDNSProvidersRequest) (*pb.ListEnabledDNSProvidersResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -105,7 +105,7 @@ func (this *DNSProviderService) ListEnabledDNSProviders(ctx context.Context, req
 | 
			
		||||
// FindAllEnabledDNSProviders 查找所有的DNS服务商
 | 
			
		||||
func (this *DNSProviderService) FindAllEnabledDNSProviders(ctx context.Context, req *pb.FindAllEnabledDNSProvidersRequest) (*pb.FindAllEnabledDNSProvidersResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -139,7 +139,7 @@ func (this *DNSProviderService) FindAllEnabledDNSProviders(ctx context.Context,
 | 
			
		||||
// DeleteDNSProvider 删除服务商
 | 
			
		||||
func (this *DNSProviderService) DeleteDNSProvider(ctx context.Context, req *pb.DeleteDNSProviderRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ type FileService struct {
 | 
			
		||||
 | 
			
		||||
// FindEnabledFile 查找文件
 | 
			
		||||
func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnabledFileRequest) (*pb.FindEnabledFileResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -49,7 +49,7 @@ func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnable
 | 
			
		||||
 | 
			
		||||
// CreateFile 创建文件
 | 
			
		||||
func (this *FileService) CreateFile(ctx context.Context, req *pb.CreateFileRequest) (*pb.CreateFileResponse, error) {
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -65,7 +65,7 @@ func (this *FileService) CreateFile(ctx context.Context, req *pb.CreateFileReque
 | 
			
		||||
 | 
			
		||||
// UpdateFileFinished 将文件置为已完成
 | 
			
		||||
func (this *FileService) UpdateFileFinished(ctx context.Context, req *pb.UpdateFileFinishedRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type FileChunkService struct {
 | 
			
		||||
// CreateFileChunk 创建文件片段
 | 
			
		||||
func (this *FileChunkService) CreateFileChunk(ctx context.Context, req *pb.CreateFileChunkRequest) (*pb.CreateFileChunkResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ func (this *HTTPAccessLogService) CreateHTTPAccessLogs(ctx context.Context, req
 | 
			
		||||
// ListHTTPAccessLogs 列出单页访问日志
 | 
			
		||||
func (this *HTTPAccessLogService) ListHTTPAccessLogs(ctx context.Context, req *pb.ListHTTPAccessLogsRequest) (*pb.ListHTTPAccessLogsResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -131,7 +131,7 @@ func (this *HTTPAccessLogService) ListHTTPAccessLogs(ctx context.Context, req *p
 | 
			
		||||
// FindHTTPAccessLog 查找单个日志
 | 
			
		||||
func (this *HTTPAccessLogService) FindHTTPAccessLog(ctx context.Context, req *pb.FindHTTPAccessLogRequest) (*pb.FindHTTPAccessLogResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type HTTPAuthPolicyService struct {
 | 
			
		||||
 | 
			
		||||
// CreateHTTPAuthPolicy 创建策略
 | 
			
		||||
func (this *HTTPAuthPolicyService) CreateHTTPAuthPolicy(ctx context.Context, req *pb.CreateHTTPAuthPolicyRequest) (*pb.CreateHTTPAuthPolicyResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -30,7 +30,7 @@ func (this *HTTPAuthPolicyService) CreateHTTPAuthPolicy(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// UpdateHTTPAuthPolicy 修改策略
 | 
			
		||||
func (this *HTTPAuthPolicyService) UpdateHTTPAuthPolicy(ctx context.Context, req *pb.UpdateHTTPAuthPolicyRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -54,7 +54,7 @@ func (this *HTTPAuthPolicyService) UpdateHTTPAuthPolicy(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// FindEnabledHTTPAuthPolicy 查找策略信息
 | 
			
		||||
func (this *HTTPAuthPolicyService) FindEnabledHTTPAuthPolicy(ctx context.Context, req *pb.FindEnabledHTTPAuthPolicyRequest) (*pb.FindEnabledHTTPAuthPolicyResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -130,7 +130,7 @@ func (this *HTTPCachePolicyService) ListEnabledHTTPCachePolicies(ctx context.Con
 | 
			
		||||
// FindEnabledHTTPCachePolicyConfig 查找单个缓存策略配置
 | 
			
		||||
func (this *HTTPCachePolicyService) FindEnabledHTTPCachePolicyConfig(ctx context.Context, req *pb.FindEnabledHTTPCachePolicyConfigRequest) (*pb.FindEnabledHTTPCachePolicyConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ type HTTPCacheTaskService struct {
 | 
			
		||||
 | 
			
		||||
// CreateHTTPCacheTask 创建任务
 | 
			
		||||
func (this *HTTPCacheTaskService) CreateHTTPCacheTask(ctx context.Context, req *pb.CreateHTTPCacheTaskRequest) (*pb.CreateHTTPCacheTaskResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -161,7 +161,7 @@ func (this *HTTPCacheTaskService) CreateHTTPCacheTask(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// CountHTTPCacheTasks 计算任务数量
 | 
			
		||||
func (this *HTTPCacheTaskService) CountHTTPCacheTasks(ctx context.Context, req *pb.CountHTTPCacheTasksRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -176,7 +176,7 @@ func (this *HTTPCacheTaskService) CountHTTPCacheTasks(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// CountDoingHTTPCacheTasks 计算正在执行的任务数量
 | 
			
		||||
func (this *HTTPCacheTaskService) CountDoingHTTPCacheTasks(ctx context.Context, req *pb.CountDoingHTTPCacheTasksRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -191,7 +191,7 @@ func (this *HTTPCacheTaskService) CountDoingHTTPCacheTasks(ctx context.Context,
 | 
			
		||||
 | 
			
		||||
// ListHTTPCacheTasks 列出单页任务
 | 
			
		||||
func (this *HTTPCacheTaskService) ListHTTPCacheTasks(ctx context.Context, req *pb.ListHTTPCacheTasksRequest) (*pb.ListHTTPCacheTasksResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -253,7 +253,7 @@ func (this *HTTPCacheTaskService) ListHTTPCacheTasks(ctx context.Context, req *p
 | 
			
		||||
 | 
			
		||||
// FindEnabledHTTPCacheTask 查找单个任务
 | 
			
		||||
func (this *HTTPCacheTaskService) FindEnabledHTTPCacheTask(ctx context.Context, req *pb.FindEnabledHTTPCacheTaskRequest) (*pb.FindEnabledHTTPCacheTaskResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -336,7 +336,7 @@ func (this *HTTPCacheTaskService) FindEnabledHTTPCacheTask(ctx context.Context,
 | 
			
		||||
 | 
			
		||||
// DeleteHTTPCacheTask 删除任务
 | 
			
		||||
func (this *HTTPCacheTaskService) DeleteHTTPCacheTask(ctx context.Context, req *pb.DeleteHTTPCacheTaskRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ type HTTPCacheTaskKeyService struct {
 | 
			
		||||
 | 
			
		||||
// ValidateHTTPCacheTaskKeys 校验缓存Key
 | 
			
		||||
func (this *HTTPCacheTaskKeyService) ValidateHTTPCacheTaskKeys(ctx context.Context, req *pb.ValidateHTTPCacheTaskKeysRequest) (*pb.ValidateHTTPCacheTaskKeysResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type HTTPFastcgiService struct {
 | 
			
		||||
 | 
			
		||||
// CreateHTTPFastcgi 创建Fastcgi
 | 
			
		||||
func (this *HTTPFastcgiService) CreateHTTPFastcgi(ctx context.Context, req *pb.CreateHTTPFastcgiRequest) (*pb.CreateHTTPFastcgiResponse, error) {
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -32,7 +32,7 @@ func (this *HTTPFastcgiService) CreateHTTPFastcgi(ctx context.Context, req *pb.C
 | 
			
		||||
 | 
			
		||||
// UpdateHTTPFastcgi 修改Fastcgi
 | 
			
		||||
func (this *HTTPFastcgiService) UpdateHTTPFastcgi(ctx context.Context, req *pb.UpdateHTTPFastcgiRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -53,7 +53,7 @@ func (this *HTTPFastcgiService) UpdateHTTPFastcgi(ctx context.Context, req *pb.U
 | 
			
		||||
 | 
			
		||||
// FindEnabledHTTPFastcgi 获取Fastcgi详情
 | 
			
		||||
func (this *HTTPFastcgiService) FindEnabledHTTPFastcgi(ctx context.Context, req *pb.FindEnabledHTTPFastcgiRequest) (*pb.FindEnabledHTTPFastcgiResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -87,7 +87,7 @@ func (this *HTTPFastcgiService) FindEnabledHTTPFastcgi(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// FindEnabledHTTPFastcgiConfig 获取Fastcgi配置
 | 
			
		||||
func (this *HTTPFastcgiService) FindEnabledHTTPFastcgiConfig(ctx context.Context, req *pb.FindEnabledHTTPFastcgiConfigRequest) (*pb.FindEnabledHTTPFastcgiConfigResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ func (this *HTTPFirewallPolicyService) FindAllEnabledHTTPFirewallPolicies(ctx co
 | 
			
		||||
// CreateHTTPFirewallPolicy 创建防火墙策略
 | 
			
		||||
func (this *HTTPFirewallPolicyService) CreateHTTPFirewallPolicy(ctx context.Context, req *pb.CreateHTTPFirewallPolicyRequest) (*pb.CreateHTTPFirewallPolicyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -121,7 +121,7 @@ func (this *HTTPFirewallPolicyService) CreateHTTPFirewallPolicy(ctx context.Cont
 | 
			
		||||
// CreateEmptyHTTPFirewallPolicy 创建空防火墙策略
 | 
			
		||||
func (this *HTTPFirewallPolicyService) CreateEmptyHTTPFirewallPolicy(ctx context.Context, req *pb.CreateEmptyHTTPFirewallPolicyRequest) (*pb.CreateEmptyHTTPFirewallPolicyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -311,7 +311,7 @@ func (this *HTTPFirewallPolicyService) UpdateHTTPFirewallPolicy(ctx context.Cont
 | 
			
		||||
// UpdateHTTPFirewallPolicyGroups 修改分组信息
 | 
			
		||||
func (this *HTTPFirewallPolicyService) UpdateHTTPFirewallPolicyGroups(ctx context.Context, req *pb.UpdateHTTPFirewallPolicyGroupsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -336,7 +336,7 @@ func (this *HTTPFirewallPolicyService) UpdateHTTPFirewallPolicyGroups(ctx contex
 | 
			
		||||
// UpdateHTTPFirewallInboundConfig 修改inbound信息
 | 
			
		||||
func (this *HTTPFirewallPolicyService) UpdateHTTPFirewallInboundConfig(ctx context.Context, req *pb.UpdateHTTPFirewallInboundConfigRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -428,7 +428,7 @@ func (this *HTTPFirewallPolicyService) DeleteHTTPFirewallPolicy(ctx context.Cont
 | 
			
		||||
// FindEnabledHTTPFirewallPolicyConfig 查找单个防火墙配置
 | 
			
		||||
func (this *HTTPFirewallPolicyService) FindEnabledHTTPFirewallPolicyConfig(ctx context.Context, req *pb.FindEnabledHTTPFirewallPolicyConfigRequest) (*pb.FindEnabledHTTPFirewallPolicyConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -462,7 +462,7 @@ func (this *HTTPFirewallPolicyService) FindEnabledHTTPFirewallPolicyConfig(ctx c
 | 
			
		||||
// FindEnabledHTTPFirewallPolicy 获取防火墙的基本信息
 | 
			
		||||
func (this *HTTPFirewallPolicyService) FindEnabledHTTPFirewallPolicy(ctx context.Context, req *pb.FindEnabledHTTPFirewallPolicyRequest) (*pb.FindEnabledHTTPFirewallPolicyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type HTTPFirewallRuleGroupService struct {
 | 
			
		||||
// UpdateHTTPFirewallRuleGroupIsOn 设置是否启用分组
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroupIsOn(ctx context.Context, req *pb.UpdateHTTPFirewallRuleGroupIsOnRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -43,7 +43,7 @@ func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroupIsOn(ctx co
 | 
			
		||||
// CreateHTTPFirewallRuleGroup 创建分组
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) CreateHTTPFirewallRuleGroup(ctx context.Context, req *pb.CreateHTTPFirewallRuleGroupRequest) (*pb.CreateHTTPFirewallRuleGroupResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -60,7 +60,7 @@ func (this *HTTPFirewallRuleGroupService) CreateHTTPFirewallRuleGroup(ctx contex
 | 
			
		||||
// UpdateHTTPFirewallRuleGroup 修改分组
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroup(ctx context.Context, req *pb.UpdateHTTPFirewallRuleGroupRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -86,7 +86,7 @@ func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroup(ctx contex
 | 
			
		||||
// FindEnabledHTTPFirewallRuleGroupConfig 获取分组配置
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) FindEnabledHTTPFirewallRuleGroupConfig(ctx context.Context, req *pb.FindEnabledHTTPFirewallRuleGroupConfigRequest) (*pb.FindEnabledHTTPFirewallRuleGroupConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -118,7 +118,7 @@ func (this *HTTPFirewallRuleGroupService) FindEnabledHTTPFirewallRuleGroupConfig
 | 
			
		||||
// FindEnabledHTTPFirewallRuleGroup 获取分组信息
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) FindEnabledHTTPFirewallRuleGroup(ctx context.Context, req *pb.FindEnabledHTTPFirewallRuleGroupRequest) (*pb.FindEnabledHTTPFirewallRuleGroupResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -157,7 +157,7 @@ func (this *HTTPFirewallRuleGroupService) FindEnabledHTTPFirewallRuleGroup(ctx c
 | 
			
		||||
// UpdateHTTPFirewallRuleGroupSets 修改分组的规则集
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroupSets(ctx context.Context, req *pb.UpdateHTTPFirewallRuleGroupSetsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -182,7 +182,7 @@ func (this *HTTPFirewallRuleGroupService) UpdateHTTPFirewallRuleGroupSets(ctx co
 | 
			
		||||
// AddHTTPFirewallRuleGroupSet 添加规则集
 | 
			
		||||
func (this *HTTPFirewallRuleGroupService) AddHTTPFirewallRuleGroupSet(ctx context.Context, req *pb.AddHTTPFirewallRuleGroupSetRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type HTTPFirewallRuleSetService struct {
 | 
			
		||||
// CreateOrUpdateHTTPFirewallRuleSetFromConfig 根据配置创建规则集
 | 
			
		||||
func (this *HTTPFirewallRuleSetService) CreateOrUpdateHTTPFirewallRuleSetFromConfig(ctx context.Context, req *pb.CreateOrUpdateHTTPFirewallRuleSetFromConfigRequest) (*pb.CreateOrUpdateHTTPFirewallRuleSetFromConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -47,7 +47,7 @@ func (this *HTTPFirewallRuleSetService) CreateOrUpdateHTTPFirewallRuleSetFromCon
 | 
			
		||||
// UpdateHTTPFirewallRuleSetIsOn 修改是否开启
 | 
			
		||||
func (this *HTTPFirewallRuleSetService) UpdateHTTPFirewallRuleSetIsOn(ctx context.Context, req *pb.UpdateHTTPFirewallRuleSetIsOnRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -72,7 +72,7 @@ func (this *HTTPFirewallRuleSetService) UpdateHTTPFirewallRuleSetIsOn(ctx contex
 | 
			
		||||
// FindEnabledHTTPFirewallRuleSetConfig 查找规则集配置
 | 
			
		||||
func (this *HTTPFirewallRuleSetService) FindEnabledHTTPFirewallRuleSetConfig(ctx context.Context, req *pb.FindEnabledHTTPFirewallRuleSetConfigRequest) (*pb.FindEnabledHTTPFirewallRuleSetConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -103,7 +103,7 @@ func (this *HTTPFirewallRuleSetService) FindEnabledHTTPFirewallRuleSetConfig(ctx
 | 
			
		||||
// FindEnabledHTTPFirewallRuleSet 查找规则集
 | 
			
		||||
func (this *HTTPFirewallRuleSetService) FindEnabledHTTPFirewallRuleSet(ctx context.Context, req *pb.FindEnabledHTTPFirewallRuleSetRequest) (*pb.FindEnabledHTTPFirewallRuleSetResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type HTTPHeaderService struct {
 | 
			
		||||
// CreateHTTPHeader 创建Header
 | 
			
		||||
func (this *HTTPHeaderService) CreateHTTPHeader(ctx context.Context, req *pb.CreateHTTPHeaderRequest) (*pb.CreateHTTPHeaderResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -53,7 +53,7 @@ func (this *HTTPHeaderService) CreateHTTPHeader(ctx context.Context, req *pb.Cre
 | 
			
		||||
// UpdateHTTPHeader 修改Header
 | 
			
		||||
func (this *HTTPHeaderService) UpdateHTTPHeader(ctx context.Context, req *pb.UpdateHTTPHeaderRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -90,7 +90,7 @@ func (this *HTTPHeaderService) UpdateHTTPHeader(ctx context.Context, req *pb.Upd
 | 
			
		||||
// FindEnabledHTTPHeaderConfig 查找配置
 | 
			
		||||
func (this *HTTPHeaderService) FindEnabledHTTPHeaderConfig(ctx context.Context, req *pb.FindEnabledHTTPHeaderConfigRequest) (*pb.FindEnabledHTTPHeaderConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,13 +13,15 @@ type HTTPHeaderPolicyService struct {
 | 
			
		||||
 | 
			
		||||
// FindEnabledHTTPHeaderPolicyConfig 查找策略配置
 | 
			
		||||
func (this *HTTPHeaderPolicyService) FindEnabledHTTPHeaderPolicyConfig(ctx context.Context, req *pb.FindEnabledHTTPHeaderPolicyConfigRequest) (*pb.FindEnabledHTTPHeaderPolicyConfigResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	config, err := models.SharedHTTPHeaderPolicyDAO.ComposeHeaderPolicyConfig(tx, req.HeaderPolicyId)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -33,15 +35,17 @@ func (this *HTTPHeaderPolicyService) FindEnabledHTTPHeaderPolicyConfig(ctx conte
 | 
			
		||||
	return &pb.FindEnabledHTTPHeaderPolicyConfigResponse{HeaderPolicyJSON: configData}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 创建策略
 | 
			
		||||
// CreateHTTPHeaderPolicy 创建策略
 | 
			
		||||
func (this *HTTPHeaderPolicyService) CreateHTTPHeaderPolicy(ctx context.Context, req *pb.CreateHTTPHeaderPolicyRequest) (*pb.CreateHTTPHeaderPolicyResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	headerPolicyId, err := models.SharedHTTPHeaderPolicyDAO.CreateHeaderPolicy(tx)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -50,15 +54,17 @@ func (this *HTTPHeaderPolicyService) CreateHTTPHeaderPolicy(ctx context.Context,
 | 
			
		||||
	return &pb.CreateHTTPHeaderPolicyResponse{HeaderPolicyId: headerPolicyId}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 修改AddHeaders
 | 
			
		||||
// UpdateHTTPHeaderPolicyAddingHeaders 修改AddHeaders
 | 
			
		||||
func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyAddingHeaders(ctx context.Context, req *pb.UpdateHTTPHeaderPolicyAddingHeadersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	err = models.SharedHTTPHeaderPolicyDAO.UpdateAddingHeaders(tx, req.HeaderPolicyId, req.HeadersJSON)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -67,15 +73,17 @@ func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyAddingHeaders(ctx con
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 修改SetHeaders
 | 
			
		||||
// UpdateHTTPHeaderPolicySettingHeaders 修改SetHeaders
 | 
			
		||||
func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicySettingHeaders(ctx context.Context, req *pb.UpdateHTTPHeaderPolicySettingHeadersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	err = models.SharedHTTPHeaderPolicyDAO.UpdateSettingHeaders(tx, req.HeaderPolicyId, req.HeadersJSON)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -84,15 +92,17 @@ func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicySettingHeaders(ctx co
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 修改AddTrailers
 | 
			
		||||
// UpdateHTTPHeaderPolicyAddingTrailers 修改AddTrailers
 | 
			
		||||
func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyAddingTrailers(ctx context.Context, req *pb.UpdateHTTPHeaderPolicyAddingTrailersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	err = models.SharedHTTPHeaderPolicyDAO.UpdateAddingTrailers(tx, req.HeaderPolicyId, req.HeadersJSON)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -101,15 +111,17 @@ func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyAddingTrailers(ctx co
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 修改ReplaceHeaders
 | 
			
		||||
// UpdateHTTPHeaderPolicyReplacingHeaders 修改ReplaceHeaders
 | 
			
		||||
func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyReplacingHeaders(ctx context.Context, req *pb.UpdateHTTPHeaderPolicyReplacingHeadersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	err = models.SharedHTTPHeaderPolicyDAO.UpdateReplacingHeaders(tx, req.HeaderPolicyId, req.HeadersJSON)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -118,15 +130,17 @@ func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyReplacingHeaders(ctx
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 修改删除的Headers
 | 
			
		||||
// UpdateHTTPHeaderPolicyDeletingHeaders 修改删除的Headers
 | 
			
		||||
func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyDeletingHeaders(ctx context.Context, req *pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
 | 
			
		||||
	// TODO 检查权限
 | 
			
		||||
 | 
			
		||||
	err = models.SharedHTTPHeaderPolicyDAO.UpdateDeletingHeaders(tx, req.HeaderPolicyId, req.HeaderNames)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ func (this *HTTPLocationService) DeleteHTTPLocation(ctx context.Context, req *pb
 | 
			
		||||
// FindAndInitHTTPLocationReverseProxyConfig 查找反向代理设置
 | 
			
		||||
func (this *HTTPLocationService) FindAndInitHTTPLocationReverseProxyConfig(ctx context.Context, req *pb.FindAndInitHTTPLocationReverseProxyConfigRequest) (*pb.FindAndInitHTTPLocationReverseProxyConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -144,7 +144,7 @@ func (this *HTTPLocationService) FindAndInitHTTPLocationReverseProxyConfig(ctx c
 | 
			
		||||
// FindAndInitHTTPLocationWebConfig 初始化Web设置
 | 
			
		||||
func (this *HTTPLocationService) FindAndInitHTTPLocationWebConfig(ctx context.Context, req *pb.FindAndInitHTTPLocationWebConfigRequest) (*pb.FindAndInitHTTPLocationWebConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, rpcutils.Wrap("ValidateRequest()", err)
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type HTTPPageService struct {
 | 
			
		||||
// CreateHTTPPage 创建Page
 | 
			
		||||
func (this *HTTPPageService) CreateHTTPPage(ctx context.Context, req *pb.CreateHTTPPageRequest) (*pb.CreateHTTPPageResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -33,7 +33,7 @@ func (this *HTTPPageService) CreateHTTPPage(ctx context.Context, req *pb.CreateH
 | 
			
		||||
// UpdateHTTPPage 修改Page
 | 
			
		||||
func (this *HTTPPageService) UpdateHTTPPage(ctx context.Context, req *pb.UpdateHTTPPageRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -57,7 +57,7 @@ func (this *HTTPPageService) UpdateHTTPPage(ctx context.Context, req *pb.UpdateH
 | 
			
		||||
// FindEnabledHTTPPageConfig 查找单个Page配置
 | 
			
		||||
func (this *HTTPPageService) FindEnabledHTTPPageConfig(ctx context.Context, req *pb.FindEnabledHTTPPageConfigRequest) (*pb.FindEnabledHTTPPageConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type HTTPWebService struct {
 | 
			
		||||
// CreateHTTPWeb 创建Web配置
 | 
			
		||||
func (this *HTTPWebService) CreateHTTPWeb(ctx context.Context, req *pb.CreateHTTPWebRequest) (*pb.CreateHTTPWebResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -35,7 +35,7 @@ func (this *HTTPWebService) CreateHTTPWeb(ctx context.Context, req *pb.CreateHTT
 | 
			
		||||
// FindEnabledHTTPWeb 查找Web配置
 | 
			
		||||
func (this *HTTPWebService) FindEnabledHTTPWeb(ctx context.Context, req *pb.FindEnabledHTTPWebRequest) (*pb.FindEnabledHTTPWebResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -68,7 +68,7 @@ func (this *HTTPWebService) FindEnabledHTTPWeb(ctx context.Context, req *pb.Find
 | 
			
		||||
// FindEnabledHTTPWebConfig 查找Web配置
 | 
			
		||||
func (this *HTTPWebService) FindEnabledHTTPWebConfig(ctx context.Context, req *pb.FindEnabledHTTPWebConfigRequest) (*pb.FindEnabledHTTPWebConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -98,7 +98,7 @@ func (this *HTTPWebService) FindEnabledHTTPWebConfig(ctx context.Context, req *p
 | 
			
		||||
// UpdateHTTPWeb 修改Web配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWeb(ctx context.Context, req *pb.UpdateHTTPWebRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -124,7 +124,7 @@ func (this *HTTPWebService) UpdateHTTPWeb(ctx context.Context, req *pb.UpdateHTT
 | 
			
		||||
// UpdateHTTPWebCompression 修改压缩配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebCompression(ctx context.Context, req *pb.UpdateHTTPWebCompressionRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -150,7 +150,7 @@ func (this *HTTPWebService) UpdateHTTPWebCompression(ctx context.Context, req *p
 | 
			
		||||
// UpdateHTTPWebWebP 修改WebP配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebWebP(ctx context.Context, req *pb.UpdateHTTPWebWebPRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -176,7 +176,7 @@ func (this *HTTPWebService) UpdateHTTPWebWebP(ctx context.Context, req *pb.Updat
 | 
			
		||||
// UpdateHTTPWebRemoteAddr 更改RemoteAddr配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebRemoteAddr(ctx context.Context, req *pb.UpdateHTTPWebRemoteAddrRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -201,7 +201,7 @@ func (this *HTTPWebService) UpdateHTTPWebRemoteAddr(ctx context.Context, req *pb
 | 
			
		||||
// UpdateHTTPWebCharset 修改字符集配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebCharset(ctx context.Context, req *pb.UpdateHTTPWebCharsetRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -226,7 +226,7 @@ func (this *HTTPWebService) UpdateHTTPWebCharset(ctx context.Context, req *pb.Up
 | 
			
		||||
// UpdateHTTPWebRequestHeader 更改请求Header策略
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebRequestHeader(ctx context.Context, req *pb.UpdateHTTPWebRequestHeaderRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -252,7 +252,7 @@ func (this *HTTPWebService) UpdateHTTPWebRequestHeader(ctx context.Context, req
 | 
			
		||||
// UpdateHTTPWebResponseHeader 更改响应Header策略
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebResponseHeader(ctx context.Context, req *pb.UpdateHTTPWebResponseHeaderRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -278,7 +278,7 @@ func (this *HTTPWebService) UpdateHTTPWebResponseHeader(ctx context.Context, req
 | 
			
		||||
// UpdateHTTPWebShutdown 更改Shutdown
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebShutdown(ctx context.Context, req *pb.UpdateHTTPWebShutdownRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -303,7 +303,7 @@ func (this *HTTPWebService) UpdateHTTPWebShutdown(ctx context.Context, req *pb.U
 | 
			
		||||
// UpdateHTTPWebPages 更改Pages
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebPages(ctx context.Context, req *pb.UpdateHTTPWebPagesRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -328,7 +328,7 @@ func (this *HTTPWebService) UpdateHTTPWebPages(ctx context.Context, req *pb.Upda
 | 
			
		||||
// UpdateHTTPWebAccessLog 更改访问日志配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebAccessLog(ctx context.Context, req *pb.UpdateHTTPWebAccessLogRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -353,7 +353,7 @@ func (this *HTTPWebService) UpdateHTTPWebAccessLog(ctx context.Context, req *pb.
 | 
			
		||||
// UpdateHTTPWebStat 更改统计配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebStat(ctx context.Context, req *pb.UpdateHTTPWebStatRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -378,7 +378,7 @@ func (this *HTTPWebService) UpdateHTTPWebStat(ctx context.Context, req *pb.Updat
 | 
			
		||||
// UpdateHTTPWebCache 更改缓存配置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebCache(ctx context.Context, req *pb.UpdateHTTPWebCacheRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -404,7 +404,7 @@ func (this *HTTPWebService) UpdateHTTPWebCache(ctx context.Context, req *pb.Upda
 | 
			
		||||
// UpdateHTTPWebFirewall 更改防火墙设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebFirewall(ctx context.Context, req *pb.UpdateHTTPWebFirewallRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -430,7 +430,7 @@ func (this *HTTPWebService) UpdateHTTPWebFirewall(ctx context.Context, req *pb.U
 | 
			
		||||
// UpdateHTTPWebLocations 更改路由规则设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebLocations(ctx context.Context, req *pb.UpdateHTTPWebLocationsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -456,7 +456,7 @@ func (this *HTTPWebService) UpdateHTTPWebLocations(ctx context.Context, req *pb.
 | 
			
		||||
// UpdateHTTPWebRedirectToHTTPS 更改跳转到HTTPS设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebRedirectToHTTPS(ctx context.Context, req *pb.UpdateHTTPWebRedirectToHTTPSRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -481,7 +481,7 @@ func (this *HTTPWebService) UpdateHTTPWebRedirectToHTTPS(ctx context.Context, re
 | 
			
		||||
// UpdateHTTPWebWebsocket 更改Websocket设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebWebsocket(ctx context.Context, req *pb.UpdateHTTPWebWebsocketRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -505,7 +505,7 @@ func (this *HTTPWebService) UpdateHTTPWebWebsocket(ctx context.Context, req *pb.
 | 
			
		||||
// UpdateHTTPWebFastcgi 更改Fastcgi设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebFastcgi(ctx context.Context, req *pb.UpdateHTTPWebFastcgiRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -529,7 +529,7 @@ func (this *HTTPWebService) UpdateHTTPWebFastcgi(ctx context.Context, req *pb.Up
 | 
			
		||||
// UpdateHTTPWebRewriteRules 更改重写规则设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebRewriteRules(ctx context.Context, req *pb.UpdateHTTPWebRewriteRulesRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -553,7 +553,7 @@ func (this *HTTPWebService) UpdateHTTPWebRewriteRules(ctx context.Context, req *
 | 
			
		||||
// UpdateHTTPWebHostRedirects 更改主机跳转设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebHostRedirects(ctx context.Context, req *pb.UpdateHTTPWebHostRedirectsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -593,7 +593,7 @@ func (this *HTTPWebService) UpdateHTTPWebHostRedirects(ctx context.Context, req
 | 
			
		||||
// FindHTTPWebHostRedirects 查找主机跳转设置
 | 
			
		||||
func (this *HTTPWebService) FindHTTPWebHostRedirects(ctx context.Context, req *pb.FindHTTPWebHostRedirectsRequest) (*pb.FindHTTPWebHostRedirectsResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -616,7 +616,7 @@ func (this *HTTPWebService) FindHTTPWebHostRedirects(ctx context.Context, req *p
 | 
			
		||||
// UpdateHTTPWebAuth 更改认证设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebAuth(ctx context.Context, req *pb.UpdateHTTPWebAuthRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -639,7 +639,7 @@ func (this *HTTPWebService) UpdateHTTPWebAuth(ctx context.Context, req *pb.Updat
 | 
			
		||||
// UpdateHTTPWebCommon 更改通用设置
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebCommon(ctx context.Context, req *pb.UpdateHTTPWebCommonRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -663,7 +663,7 @@ func (this *HTTPWebService) UpdateHTTPWebCommon(ctx context.Context, req *pb.Upd
 | 
			
		||||
 | 
			
		||||
// UpdateHTTPWebRequestLimit 修改请求限制
 | 
			
		||||
func (this *HTTPWebService) UpdateHTTPWebRequestLimit(ctx context.Context, req *pb.UpdateHTTPWebRequestLimitRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ type HTTPWebsocketService struct {
 | 
			
		||||
// 创建Websocket配置
 | 
			
		||||
func (this *HTTPWebsocketService) CreateHTTPWebsocket(ctx context.Context, req *pb.CreateHTTPWebsocketRequest) (*pb.CreateHTTPWebsocketResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -30,7 +30,7 @@ func (this *HTTPWebsocketService) CreateHTTPWebsocket(ctx context.Context, req *
 | 
			
		||||
// 修改Websocket配置
 | 
			
		||||
func (this *HTTPWebsocketService) UpdateHTTPWebsocket(ctx context.Context, req *pb.UpdateHTTPWebsocketRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,7 @@ func (this *IPItemService) CreateIPItem(ctx context.Context, req *pb.CreateIPIte
 | 
			
		||||
// UpdateIPItem 修改IP
 | 
			
		||||
func (this *IPItemService) UpdateIPItem(ctx context.Context, req *pb.UpdateIPItemRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -109,7 +109,7 @@ func (this *IPItemService) UpdateIPItem(ctx context.Context, req *pb.UpdateIPIte
 | 
			
		||||
// DeleteIPItem 删除IP
 | 
			
		||||
func (this *IPItemService) DeleteIPItem(ctx context.Context, req *pb.DeleteIPItemRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -175,7 +175,7 @@ func (this *IPItemService) DeleteIPItems(ctx context.Context, req *pb.DeleteIPIt
 | 
			
		||||
// CountIPItemsWithListId 计算IP数量
 | 
			
		||||
func (this *IPItemService) CountIPItemsWithListId(ctx context.Context, req *pb.CountIPItemsWithListIdRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -199,7 +199,7 @@ func (this *IPItemService) CountIPItemsWithListId(ctx context.Context, req *pb.C
 | 
			
		||||
// ListIPItemsWithListId 列出单页的IP
 | 
			
		||||
func (this *IPItemService) ListIPItemsWithListId(ctx context.Context, req *pb.ListIPItemsWithListIdRequest) (*pb.ListIPItemsWithListIdResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -309,7 +309,7 @@ func (this *IPItemService) ListIPItemsWithListId(ctx context.Context, req *pb.Li
 | 
			
		||||
// FindEnabledIPItem 查找单个IP
 | 
			
		||||
func (this *IPItemService) FindEnabledIPItem(ctx context.Context, req *pb.FindEnabledIPItemRequest) (*pb.FindEnabledIPItemResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -177,7 +177,7 @@ func (this *IPLibraryService) DeleteIPLibrary(ctx context.Context, req *pb.Delet
 | 
			
		||||
// LookupIPRegion 查询某个IP信息
 | 
			
		||||
func (this *IPLibraryService) LookupIPRegion(ctx context.Context, req *pb.LookupIPRegionRequest) (*pb.LookupIPRegionResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -202,7 +202,7 @@ func (this *IPLibraryService) LookupIPRegion(ctx context.Context, req *pb.Lookup
 | 
			
		||||
// LookupIPRegions 查询一组IP信息
 | 
			
		||||
func (this *IPLibraryService) LookupIPRegions(ctx context.Context, req *pb.LookupIPRegionsRequest) (*pb.LookupIPRegionsResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type IPListService struct {
 | 
			
		||||
// CreateIPList 创建IP列表
 | 
			
		||||
func (this *IPListService) CreateIPList(ctx context.Context, req *pb.CreateIPListRequest) (*pb.CreateIPListResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -61,7 +61,7 @@ func (this *IPListService) UpdateIPList(ctx context.Context, req *pb.UpdateIPLis
 | 
			
		||||
// FindEnabledIPList 查找IP列表
 | 
			
		||||
func (this *IPListService) FindEnabledIPList(ctx context.Context, req *pb.FindEnabledIPListRequest) (*pb.FindEnabledIPListResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type LoginService struct {
 | 
			
		||||
 | 
			
		||||
// FindEnabledLogin 查找认证
 | 
			
		||||
func (this *LoginService) FindEnabledLogin(ctx context.Context, req *pb.FindEnabledLoginRequest) (*pb.FindEnabledLoginResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -46,7 +46,7 @@ func (this *LoginService) FindEnabledLogin(ctx context.Context, req *pb.FindEnab
 | 
			
		||||
 | 
			
		||||
// UpdateLogin 修改认证
 | 
			
		||||
func (this *LoginService) UpdateLogin(ctx context.Context, req *pb.UpdateLoginRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type MessageService struct {
 | 
			
		||||
// CountUnreadMessages 计算未读消息数
 | 
			
		||||
func (this *MessageService) CountUnreadMessages(ctx context.Context, req *pb.CountUnreadMessagesRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -32,7 +32,7 @@ func (this *MessageService) CountUnreadMessages(ctx context.Context, req *pb.Cou
 | 
			
		||||
// ListUnreadMessages 列出单页未读消息
 | 
			
		||||
func (this *MessageService) ListUnreadMessages(ctx context.Context, req *pb.ListUnreadMessagesRequest) (*pb.ListUnreadMessagesResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -122,7 +122,7 @@ func (this *MessageService) ListUnreadMessages(ctx context.Context, req *pb.List
 | 
			
		||||
// UpdateMessageRead 设置消息已读状态
 | 
			
		||||
func (this *MessageService) UpdateMessageRead(ctx context.Context, req *pb.UpdateMessageReadRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -148,7 +148,7 @@ func (this *MessageService) UpdateMessageRead(ctx context.Context, req *pb.Updat
 | 
			
		||||
// UpdateMessagesRead 设置一组消息已读状态
 | 
			
		||||
func (this *MessageService) UpdateMessagesRead(ctx context.Context, req *pb.UpdateMessagesReadRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -177,7 +177,7 @@ func (this *MessageService) UpdateMessagesRead(ctx context.Context, req *pb.Upda
 | 
			
		||||
func (this *MessageService) UpdateAllMessagesRead(ctx context.Context, req *pb.UpdateAllMessagesReadRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -390,7 +390,7 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List
 | 
			
		||||
 | 
			
		||||
// FindAllEnabledNodesWithNodeClusterId 查找一个集群下的所有节点
 | 
			
		||||
func (this *NodeService) FindAllEnabledNodesWithNodeClusterId(ctx context.Context, req *pb.FindAllEnabledNodesWithNodeClusterIdRequest) (*pb.FindAllEnabledNodesWithNodeClusterIdResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -160,7 +160,7 @@ func (this *NodeClusterService) DeleteNodeCluster(ctx context.Context, req *pb.D
 | 
			
		||||
 | 
			
		||||
// FindEnabledNodeCluster 查找单个集群
 | 
			
		||||
func (this *NodeClusterService) FindEnabledNodeCluster(ctx context.Context, req *pb.FindEnabledNodeClusterRequest) (*pb.FindEnabledNodeClusterResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -461,7 +461,7 @@ func (this *NodeClusterService) FindAllEnabledNodeClustersWithNodeGrantId(ctx co
 | 
			
		||||
// FindEnabledNodeClusterDNS 查找集群的DNS配置
 | 
			
		||||
func (this *NodeClusterService) FindEnabledNodeClusterDNS(ctx context.Context, req *pb.FindEnabledNodeClusterDNSRequest) (*pb.FindEnabledNodeClusterDNSResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -909,7 +909,7 @@ func (this *NodeClusterService) FindNodeClusterSystemService(ctx context.Context
 | 
			
		||||
 | 
			
		||||
// FindFreePortInNodeCluster 获取集群中可以使用的端口
 | 
			
		||||
func (this *NodeClusterService) FindFreePortInNodeCluster(ctx context.Context, req *pb.FindFreePortInNodeClusterRequest) (*pb.FindFreePortInNodeClusterResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -967,7 +967,7 @@ func (this *NodeClusterService) FindFreePortInNodeCluster(ctx context.Context, r
 | 
			
		||||
 | 
			
		||||
// CheckPortIsUsingInNodeCluster 检查端口是否已经被使用
 | 
			
		||||
func (this *NodeClusterService) CheckPortIsUsingInNodeCluster(ctx context.Context, req *pb.CheckPortIsUsingInNodeClusterRequest) (*pb.CheckPortIsUsingInNodeClusterResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1131,7 +1131,7 @@ func (this *NodeClusterService) UpdateNodeClusterPinned(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// FindEnabledNodeClusterWebPPolicy 读取集群WebP策略
 | 
			
		||||
func (this *NodeClusterService) FindEnabledNodeClusterWebPPolicy(ctx context.Context, req *pb.FindEnabledNodeClusterWebPPolicyRequest) (*pb.FindEnabledNodeClusterWebPPolicyResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1178,7 +1178,7 @@ func (this *NodeClusterService) UpdateNodeClusterWebPPolicy(ctx context.Context,
 | 
			
		||||
 | 
			
		||||
// FindEnabledNodeClusterUAMPolicy 读取集群UAM策略
 | 
			
		||||
func (this *NodeClusterService) FindEnabledNodeClusterUAMPolicy(ctx context.Context, req *pb.FindEnabledNodeClusterUAMPolicyRequest) (*pb.FindEnabledNodeClusterUAMPolicyResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ type OriginService struct {
 | 
			
		||||
 | 
			
		||||
// CreateOrigin 创建源站
 | 
			
		||||
func (this *OriginService) CreateOrigin(ctx context.Context, req *pb.CreateOriginRequest) (*pb.CreateOriginResponse, error) {
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -82,7 +82,7 @@ func (this *OriginService) CreateOrigin(ctx context.Context, req *pb.CreateOrigi
 | 
			
		||||
 | 
			
		||||
// UpdateOrigin 修改源站
 | 
			
		||||
func (this *OriginService) UpdateOrigin(ctx context.Context, req *pb.UpdateOriginRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -152,7 +152,7 @@ func (this *OriginService) UpdateOrigin(ctx context.Context, req *pb.UpdateOrigi
 | 
			
		||||
 | 
			
		||||
// FindEnabledOrigin 查找单个源站信息
 | 
			
		||||
func (this *OriginService) FindEnabledOrigin(ctx context.Context, req *pb.FindEnabledOriginRequest) (*pb.FindEnabledOriginResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -197,7 +197,7 @@ func (this *OriginService) FindEnabledOrigin(ctx context.Context, req *pb.FindEn
 | 
			
		||||
 | 
			
		||||
// FindEnabledOriginConfig 查找源站配置
 | 
			
		||||
func (this *OriginService) FindEnabledOriginConfig(ctx context.Context, req *pb.FindEnabledOriginConfigRequest) (*pb.FindEnabledOriginConfigResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type ReverseProxyService struct {
 | 
			
		||||
// CreateReverseProxy 创建反向代理
 | 
			
		||||
func (this *ReverseProxyService) CreateReverseProxy(ctx context.Context, req *pb.CreateReverseProxyRequest) (*pb.CreateReverseProxyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -38,7 +38,7 @@ func (this *ReverseProxyService) CreateReverseProxy(ctx context.Context, req *pb
 | 
			
		||||
// FindEnabledReverseProxy 查找反向代理
 | 
			
		||||
func (this *ReverseProxyService) FindEnabledReverseProxy(ctx context.Context, req *pb.FindEnabledReverseProxyRequest) (*pb.FindEnabledReverseProxyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -72,7 +72,7 @@ func (this *ReverseProxyService) FindEnabledReverseProxy(ctx context.Context, re
 | 
			
		||||
// FindEnabledReverseProxyConfig 查找反向代理配置
 | 
			
		||||
func (this *ReverseProxyService) FindEnabledReverseProxyConfig(ctx context.Context, req *pb.FindEnabledReverseProxyConfigRequest) (*pb.FindEnabledReverseProxyConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -102,7 +102,7 @@ func (this *ReverseProxyService) FindEnabledReverseProxyConfig(ctx context.Conte
 | 
			
		||||
// UpdateReverseProxyScheduling 修改反向代理调度算法
 | 
			
		||||
func (this *ReverseProxyService) UpdateReverseProxyScheduling(ctx context.Context, req *pb.UpdateReverseProxySchedulingRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -127,7 +127,7 @@ func (this *ReverseProxyService) UpdateReverseProxyScheduling(ctx context.Contex
 | 
			
		||||
// UpdateReverseProxyPrimaryOrigins 修改主要源站信息
 | 
			
		||||
func (this *ReverseProxyService) UpdateReverseProxyPrimaryOrigins(ctx context.Context, req *pb.UpdateReverseProxyPrimaryOriginsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -152,7 +152,7 @@ func (this *ReverseProxyService) UpdateReverseProxyPrimaryOrigins(ctx context.Co
 | 
			
		||||
// UpdateReverseProxyBackupOrigins 修改备用源站信息
 | 
			
		||||
func (this *ReverseProxyService) UpdateReverseProxyBackupOrigins(ctx context.Context, req *pb.UpdateReverseProxyBackupOriginsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -177,7 +177,7 @@ func (this *ReverseProxyService) UpdateReverseProxyBackupOrigins(ctx context.Con
 | 
			
		||||
// UpdateReverseProxy 修改是否启用
 | 
			
		||||
func (this *ReverseProxyService) UpdateReverseProxy(ctx context.Context, req *pb.UpdateReverseProxyRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ type ServerService struct {
 | 
			
		||||
// CreateServer 创建服务
 | 
			
		||||
func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServerRequest) (*pb.CreateServerResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -199,7 +199,7 @@ func (this *ServerService) UpdateServerBasic(ctx context.Context, req *pb.Update
 | 
			
		||||
 | 
			
		||||
// UpdateServerGroupIds 修改服务所在分组
 | 
			
		||||
func (this *ServerService) UpdateServerGroupIds(ctx context.Context, req *pb.UpdateServerGroupIdsRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -249,7 +249,7 @@ func (this *ServerService) UpdateServerGroupIds(ctx context.Context, req *pb.Upd
 | 
			
		||||
 | 
			
		||||
// UpdateServerIsOn 修改服务是否启用
 | 
			
		||||
func (this *ServerService) UpdateServerIsOn(ctx context.Context, req *pb.UpdateServerIsOnRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -272,7 +272,7 @@ func (this *ServerService) UpdateServerIsOn(ctx context.Context, req *pb.UpdateS
 | 
			
		||||
// UpdateServerHTTP 修改HTTP服务
 | 
			
		||||
func (this *ServerService) UpdateServerHTTP(ctx context.Context, req *pb.UpdateServerHTTPRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -298,7 +298,7 @@ func (this *ServerService) UpdateServerHTTP(ctx context.Context, req *pb.UpdateS
 | 
			
		||||
// UpdateServerHTTPS 修改HTTPS服务
 | 
			
		||||
func (this *ServerService) UpdateServerHTTPS(ctx context.Context, req *pb.UpdateServerHTTPSRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -324,7 +324,7 @@ func (this *ServerService) UpdateServerHTTPS(ctx context.Context, req *pb.Update
 | 
			
		||||
// UpdateServerTCP 修改TCP服务
 | 
			
		||||
func (this *ServerService) UpdateServerTCP(ctx context.Context, req *pb.UpdateServerTCPRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -350,7 +350,7 @@ func (this *ServerService) UpdateServerTCP(ctx context.Context, req *pb.UpdateSe
 | 
			
		||||
// UpdateServerTLS 修改TLS服务
 | 
			
		||||
func (this *ServerService) UpdateServerTLS(ctx context.Context, req *pb.UpdateServerTLSRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -399,7 +399,7 @@ func (this *ServerService) UpdateServerUnix(ctx context.Context, req *pb.UpdateS
 | 
			
		||||
// UpdateServerUDP 修改UDP服务
 | 
			
		||||
func (this *ServerService) UpdateServerUDP(ctx context.Context, req *pb.UpdateServerUDPRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -429,7 +429,7 @@ func (this *ServerService) UpdateServerUDP(ctx context.Context, req *pb.UpdateSe
 | 
			
		||||
// UpdateServerWeb 修改Web服务
 | 
			
		||||
func (this *ServerService) UpdateServerWeb(ctx context.Context, req *pb.UpdateServerWebRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -455,7 +455,7 @@ func (this *ServerService) UpdateServerWeb(ctx context.Context, req *pb.UpdateSe
 | 
			
		||||
// UpdateServerReverseProxy 修改反向代理服务
 | 
			
		||||
func (this *ServerService) UpdateServerReverseProxy(ctx context.Context, req *pb.UpdateServerReverseProxyRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -480,7 +480,7 @@ func (this *ServerService) UpdateServerReverseProxy(ctx context.Context, req *pb
 | 
			
		||||
 | 
			
		||||
// FindServerNames 查找服务的域名设置
 | 
			
		||||
func (this *ServerService) FindServerNames(ctx context.Context, req *pb.FindServerNamesRequest) (*pb.FindServerNamesResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -522,7 +522,7 @@ func (this *ServerService) FindServerNames(ctx context.Context, req *pb.FindServ
 | 
			
		||||
// UpdateServerNames 修改域名服务
 | 
			
		||||
func (this *ServerService) UpdateServerNames(ctx context.Context, req *pb.UpdateServerNamesRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -738,7 +738,7 @@ func (this *ServerService) FindServerIdWithDNSName(ctx context.Context, req *pb.
 | 
			
		||||
// CountAllEnabledServersMatch 计算服务数量
 | 
			
		||||
func (this *ServerService) CountAllEnabledServersMatch(ctx context.Context, req *pb.CountAllEnabledServersMatchRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -760,7 +760,7 @@ func (this *ServerService) CountAllEnabledServersMatch(ctx context.Context, req
 | 
			
		||||
// ListEnabledServersMatch 列出单页服务
 | 
			
		||||
func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.ListEnabledServersMatchRequest) (*pb.ListEnabledServersMatchResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -887,7 +887,7 @@ func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.
 | 
			
		||||
// DeleteServer 禁用某服务
 | 
			
		||||
func (this *ServerService) DeleteServer(ctx context.Context, req *pb.DeleteServerRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -913,7 +913,7 @@ func (this *ServerService) DeleteServer(ctx context.Context, req *pb.DeleteServe
 | 
			
		||||
// FindEnabledServer 查找单个服务
 | 
			
		||||
func (this *ServerService) FindEnabledServer(ctx context.Context, req *pb.FindEnabledServerRequest) (*pb.FindEnabledServerResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1029,7 +1029,7 @@ func (this *ServerService) FindEnabledServer(ctx context.Context, req *pb.FindEn
 | 
			
		||||
// FindEnabledServerConfig 查找服务配置
 | 
			
		||||
func (this *ServerService) FindEnabledServerConfig(ctx context.Context, req *pb.FindEnabledServerConfigRequest) (*pb.FindEnabledServerConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1062,7 +1062,7 @@ func (this *ServerService) FindEnabledServerConfig(ctx context.Context, req *pb.
 | 
			
		||||
// FindEnabledServerType 查找服务的服务类型
 | 
			
		||||
func (this *ServerService) FindEnabledServerType(ctx context.Context, req *pb.FindEnabledServerTypeRequest) (*pb.FindEnabledServerTypeResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1088,7 +1088,7 @@ func (this *ServerService) FindEnabledServerType(ctx context.Context, req *pb.Fi
 | 
			
		||||
// FindAndInitServerReverseProxyConfig 查找反向代理设置
 | 
			
		||||
func (this *ServerService) FindAndInitServerReverseProxyConfig(ctx context.Context, req *pb.FindAndInitServerReverseProxyConfigRequest) (*pb.FindAndInitServerReverseProxyConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1141,7 +1141,7 @@ func (this *ServerService) FindAndInitServerReverseProxyConfig(ctx context.Conte
 | 
			
		||||
// FindAndInitServerWebConfig 初始化Web设置
 | 
			
		||||
func (this *ServerService) FindAndInitServerWebConfig(ctx context.Context, req *pb.FindAndInitServerWebConfigRequest) (*pb.FindAndInitServerWebConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1182,7 +1182,7 @@ func (this *ServerService) FindAndInitServerWebConfig(ctx context.Context, req *
 | 
			
		||||
// CountAllEnabledServersWithSSLCertId 计算使用某个SSL证书的服务数量
 | 
			
		||||
func (this *ServerService) CountAllEnabledServersWithSSLCertId(ctx context.Context, req *pb.CountAllEnabledServersWithSSLCertIdRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1212,7 +1212,7 @@ func (this *ServerService) CountAllEnabledServersWithSSLCertId(ctx context.Conte
 | 
			
		||||
// FindAllEnabledServersWithSSLCertId 查找使用某个SSL证书的所有服务
 | 
			
		||||
func (this *ServerService) FindAllEnabledServersWithSSLCertId(ctx context.Context, req *pb.FindAllEnabledServersWithSSLCertIdRequest) (*pb.FindAllEnabledServersWithSSLCertIdResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1267,7 +1267,7 @@ func (this *ServerService) CountAllEnabledServersWithNodeClusterId(ctx context.C
 | 
			
		||||
// CountAllEnabledServersWithServerGroupId 计算使用某个分组的服务数量
 | 
			
		||||
func (this *ServerService) CountAllEnabledServersWithServerGroupId(ctx context.Context, req *pb.CountAllEnabledServersWithServerGroupIdRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1344,7 +1344,7 @@ func (this *ServerService) FindAllEnabledServersDNSWithNodeClusterId(ctx context
 | 
			
		||||
// FindEnabledServerDNS 查找单个服务的DNS信息
 | 
			
		||||
func (this *ServerService) FindEnabledServerDNS(ctx context.Context, req *pb.FindEnabledServerDNSRequest) (*pb.FindEnabledServerDNSResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1397,7 +1397,7 @@ func (this *ServerService) FindEnabledServerDNS(ctx context.Context, req *pb.Fin
 | 
			
		||||
 | 
			
		||||
// CheckUserServer 检查服务是否属于某个用户
 | 
			
		||||
func (this *ServerService) CheckUserServer(ctx context.Context, req *pb.CheckUserServerRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1413,7 +1413,7 @@ func (this *ServerService) CheckUserServer(ctx context.Context, req *pb.CheckUse
 | 
			
		||||
 | 
			
		||||
// FindAllEnabledServerNamesWithUserId 查找一个用户下的所有域名列表
 | 
			
		||||
func (this *ServerService) FindAllEnabledServerNamesWithUserId(ctx context.Context, req *pb.FindAllEnabledServerNamesWithUserIdRequest) (*pb.FindAllEnabledServerNamesWithUserIdResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1449,7 +1449,7 @@ func (this *ServerService) FindAllEnabledServerNamesWithUserId(ctx context.Conte
 | 
			
		||||
 | 
			
		||||
// FindEnabledUserServerBasic 查找服务基本信息
 | 
			
		||||
func (this *ServerService) FindEnabledUserServerBasic(ctx context.Context, req *pb.FindEnabledUserServerBasicRequest) (*pb.FindEnabledUserServerBasicResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1491,7 +1491,7 @@ func (this *ServerService) FindEnabledUserServerBasic(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// UpdateEnabledUserServerBasic 修改用户服务基本信息
 | 
			
		||||
func (this *ServerService) UpdateEnabledUserServerBasic(ctx context.Context, req *pb.UpdateEnabledUserServerBasicRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1696,7 +1696,7 @@ func (this *ServerService) UploadServerHTTPRequestStat(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// CheckServerNameDuplicationInNodeCluster 检查域名是否已经存在
 | 
			
		||||
func (this *ServerService) CheckServerNameDuplicationInNodeCluster(ctx context.Context, req *pb.CheckServerNameDuplicationInNodeClusterRequest) (*pb.CheckServerNameDuplicationInNodeClusterResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1933,7 +1933,7 @@ func (this *ServerService) PurgeServerCache(ctx context.Context, req *pb.PurgeSe
 | 
			
		||||
 | 
			
		||||
// FindEnabledServerTrafficLimit 查找流量限制
 | 
			
		||||
func (this *ServerService) FindEnabledServerTrafficLimit(ctx context.Context, req *pb.FindEnabledServerTrafficLimitRequest) (*pb.FindEnabledServerTrafficLimitResponse, error) {
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, _, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -1977,7 +1977,7 @@ func (this *ServerService) UpdateServerTrafficLimit(ctx context.Context, req *pb
 | 
			
		||||
 | 
			
		||||
// UpdateServerUserPlan 修改服务套餐
 | 
			
		||||
func (this *ServerService) UpdateServerUserPlan(ctx context.Context, req *pb.UpdateServerUserPlanRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -2046,7 +2046,7 @@ func (this *ServerService) UpdateServerUserPlan(ctx context.Context, req *pb.Upd
 | 
			
		||||
 | 
			
		||||
// FindServerUserPlan 获取服务套餐信息
 | 
			
		||||
func (this *ServerService) FindServerUserPlan(ctx context.Context, req *pb.FindServerUserPlanRequest) (*pb.FindServerUserPlanResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type ServerBillService struct {
 | 
			
		||||
 | 
			
		||||
// CountAllServerBills 查询服务账单数量
 | 
			
		||||
func (this *ServerBillService) CountAllServerBills(ctx context.Context, req *pb.CountAllServerBillsRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -35,7 +35,7 @@ func (this *ServerBillService) CountAllServerBills(ctx context.Context, req *pb.
 | 
			
		||||
 | 
			
		||||
// ListServerBills 查询服务账单列表
 | 
			
		||||
func (this *ServerBillService) ListServerBills(ctx context.Context, req *pb.ListServerBillsRequest) (*pb.ListServerBillsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ type ServerClientBrowserMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// FindTopServerClientBrowserMonthlyStats 查找前N个操作系统
 | 
			
		||||
func (this *ServerClientBrowserMonthlyStatService) FindTopServerClientBrowserMonthlyStats(ctx context.Context, req *pb.FindTopServerClientBrowserMonthlyStatsRequest) (*pb.FindTopServerClientBrowserMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ type ServerClientSystemMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// FindTopServerClientSystemMonthlyStats 查找前N个操作系统
 | 
			
		||||
func (this *ServerClientSystemMonthlyStatService) FindTopServerClientSystemMonthlyStats(ctx context.Context, req *pb.FindTopServerClientSystemMonthlyStatsRequest) (*pb.FindTopServerClientSystemMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -225,7 +225,7 @@ func (this *ServerDailyStatService) FindLatestServerDailyStats(ctx context.Conte
 | 
			
		||||
 | 
			
		||||
// SumCurrentServerDailyStats 查找单个服务当前统计数据
 | 
			
		||||
func (this *ServerDailyStatService) SumCurrentServerDailyStats(ctx context.Context, req *pb.SumCurrentServerDailyStatsRequest) (*pb.SumCurrentServerDailyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -266,7 +266,7 @@ func (this *ServerDailyStatService) SumCurrentServerDailyStats(ctx context.Conte
 | 
			
		||||
 | 
			
		||||
// SumServerDailyStats 计算单个服务的日统计
 | 
			
		||||
func (this *ServerDailyStatService) SumServerDailyStats(ctx context.Context, req *pb.SumServerDailyStatsRequest) (*pb.SumServerDailyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -311,7 +311,7 @@ func (this *ServerDailyStatService) SumServerDailyStats(ctx context.Context, req
 | 
			
		||||
 | 
			
		||||
// SumServerMonthlyStats 计算单个服务的月统计
 | 
			
		||||
func (this *ServerDailyStatService) SumServerMonthlyStats(ctx context.Context, req *pb.SumServerMonthlyStatsRequest) (*pb.SumServerMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ type ServerGroupService struct {
 | 
			
		||||
// CreateServerGroup 创建分组
 | 
			
		||||
func (this *ServerGroupService) CreateServerGroup(ctx context.Context, req *pb.CreateServerGroupRequest) (*pb.CreateServerGroupResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -33,7 +33,7 @@ func (this *ServerGroupService) CreateServerGroup(ctx context.Context, req *pb.C
 | 
			
		||||
// UpdateServerGroup 修改分组
 | 
			
		||||
func (this *ServerGroupService) UpdateServerGroup(ctx context.Context, req *pb.UpdateServerGroupRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -59,7 +59,7 @@ func (this *ServerGroupService) UpdateServerGroup(ctx context.Context, req *pb.U
 | 
			
		||||
// DeleteServerGroup 删除分组
 | 
			
		||||
func (this *ServerGroupService) DeleteServerGroup(ctx context.Context, req *pb.DeleteServerGroupRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -85,7 +85,7 @@ func (this *ServerGroupService) DeleteServerGroup(ctx context.Context, req *pb.D
 | 
			
		||||
// FindAllEnabledServerGroups 查询所有分组
 | 
			
		||||
func (this *ServerGroupService) FindAllEnabledServerGroups(ctx context.Context, req *pb.FindAllEnabledServerGroupsRequest) (*pb.FindAllEnabledServerGroupsResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -109,7 +109,7 @@ func (this *ServerGroupService) FindAllEnabledServerGroups(ctx context.Context,
 | 
			
		||||
// UpdateServerGroupOrders 修改分组排序
 | 
			
		||||
func (this *ServerGroupService) UpdateServerGroupOrders(ctx context.Context, req *pb.UpdateServerGroupOrdersRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -126,7 +126,7 @@ func (this *ServerGroupService) UpdateServerGroupOrders(ctx context.Context, req
 | 
			
		||||
// FindEnabledServerGroup 查找单个分组信息
 | 
			
		||||
func (this *ServerGroupService) FindEnabledServerGroup(ctx context.Context, req *pb.FindEnabledServerGroupRequest) (*pb.FindEnabledServerGroupResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -377,7 +377,7 @@ func (this *ServerGroupService) UpdateServerGroupUDPReverseProxy(ctx context.Con
 | 
			
		||||
// FindEnabledServerGroupConfigInfo 取得分组的配置概要信息
 | 
			
		||||
func (this *ServerGroupService) FindEnabledServerGroupConfigInfo(ctx context.Context, req *pb.FindEnabledServerGroupConfigInfoRequest) (*pb.FindEnabledServerGroupConfigInfoResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ type ServerHTTPFirewallDailyStatService struct {
 | 
			
		||||
 | 
			
		||||
// ComposeServerHTTPFirewallDashboard 组合Dashboard
 | 
			
		||||
func (this *ServerHTTPFirewallDailyStatService) ComposeServerHTTPFirewallDashboard(ctx context.Context, req *pb.ComposeServerHTTPFirewallDashboardRequest) (*pb.ComposeServerHTTPFirewallDashboardResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ServerRegionCityMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// 查找前N个城市
 | 
			
		||||
func (this *ServerRegionCityMonthlyStatService) FindTopServerRegionCityMonthlyStats(ctx context.Context, req *pb.FindTopServerRegionCityMonthlyStatsRequest) (*pb.FindTopServerRegionCityMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ServerRegionCountryMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// 查找前N个地区
 | 
			
		||||
func (this *ServerRegionCountryMonthlyStatService) FindTopServerRegionCountryMonthlyStats(ctx context.Context, req *pb.FindTopServerRegionCountryMonthlyStatsRequest) (*pb.FindTopServerRegionCountryMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ServerRegionProviderMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// 查找前N个运营商
 | 
			
		||||
func (this *ServerRegionProviderMonthlyStatService) FindTopServerRegionProviderMonthlyStats(ctx context.Context, req *pb.FindTopServerRegionProviderMonthlyStatsRequest) (*pb.FindTopServerRegionProviderMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ServerRegionProvinceMonthlyStatService struct {
 | 
			
		||||
 | 
			
		||||
// 查找前N个省份
 | 
			
		||||
func (this *ServerRegionProvinceMonthlyStatService) FindTopServerRegionProvinceMonthlyStats(ctx context.Context, req *pb.FindTopServerRegionProvinceMonthlyStatsRequest) (*pb.FindTopServerRegionProvinceMonthlyStatsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ type SSLCertService struct {
 | 
			
		||||
// CreateSSLCert 创建Cert
 | 
			
		||||
func (this *SSLCertService) CreateSSLCert(ctx context.Context, req *pb.CreateSSLCertRequest) (*pb.CreateSSLCertResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -44,7 +44,7 @@ func (this *SSLCertService) CreateSSLCert(ctx context.Context, req *pb.CreateSSL
 | 
			
		||||
// UpdateSSLCert 修改Cert
 | 
			
		||||
func (this *SSLCertService) UpdateSSLCert(ctx context.Context, req *pb.UpdateSSLCertRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -77,7 +77,7 @@ func (this *SSLCertService) UpdateSSLCert(ctx context.Context, req *pb.UpdateSSL
 | 
			
		||||
// FindEnabledSSLCertConfig 查找证书配置
 | 
			
		||||
func (this *SSLCertService) FindEnabledSSLCertConfig(ctx context.Context, req *pb.FindEnabledSSLCertConfigRequest) (*pb.FindEnabledSSLCertConfigResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -107,7 +107,7 @@ func (this *SSLCertService) FindEnabledSSLCertConfig(ctx context.Context, req *p
 | 
			
		||||
// DeleteSSLCert 删除证书
 | 
			
		||||
func (this *SSLCertService) DeleteSSLCert(ctx context.Context, req *pb.DeleteSSLCertRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -139,7 +139,7 @@ func (this *SSLCertService) DeleteSSLCert(ctx context.Context, req *pb.DeleteSSL
 | 
			
		||||
// CountSSLCerts 计算匹配的Cert数量
 | 
			
		||||
func (this *SSLCertService) CountSSLCerts(ctx context.Context, req *pb.CountSSLCertRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -161,7 +161,7 @@ func (this *SSLCertService) CountSSLCerts(ctx context.Context, req *pb.CountSSLC
 | 
			
		||||
// ListSSLCerts 列出单页匹配的Cert
 | 
			
		||||
func (this *SSLCertService) ListSSLCerts(ctx context.Context, req *pb.ListSSLCertsRequest) (*pb.ListSSLCertsResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type SSLPolicyService struct {
 | 
			
		||||
// CreateSSLPolicy 创建Policy
 | 
			
		||||
func (this *SSLPolicyService) CreateSSLPolicy(ctx context.Context, req *pb.CreateSSLPolicyRequest) (*pb.CreateSSLPolicyResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -55,7 +55,7 @@ func (this *SSLPolicyService) CreateSSLPolicy(ctx context.Context, req *pb.Creat
 | 
			
		||||
// UpdateSSLPolicy 修改Policy
 | 
			
		||||
func (this *SSLPolicyService) UpdateSSLPolicy(ctx context.Context, req *pb.UpdateSSLPolicyRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ type SysLockerService struct {
 | 
			
		||||
 | 
			
		||||
// SysLockerLock 获得锁
 | 
			
		||||
func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLockerLockRequest) (*pb.SysLockerLockResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		_, err = this.ValidateMonitorNode(ctx)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
@@ -43,7 +43,7 @@ func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLock
 | 
			
		||||
 | 
			
		||||
// SysLockerUnlock 释放锁
 | 
			
		||||
func (this *SysLockerService) SysLockerUnlock(ctx context.Context, req *pb.SysLockerUnlockRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		_, err = this.ValidateMonitorNode(ctx)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ func (this *SysSettingService) UpdateSysSetting(ctx context.Context, req *pb.Upd
 | 
			
		||||
// ReadSysSetting 读取配置
 | 
			
		||||
func (this *SysSettingService) ReadSysSetting(ctx context.Context, req *pb.ReadSysSettingRequest) (*pb.ReadSysSettingResponse, error) {
 | 
			
		||||
	// 校验请求
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ func (this *UserService) CreateUser(ctx context.Context, req *pb.CreateUserReque
 | 
			
		||||
 | 
			
		||||
// RegisterUser 注册用户
 | 
			
		||||
func (this *UserService) RegisterUser(ctx context.Context, req *pb.RegisterUserRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -233,7 +233,7 @@ func (this *UserService) ListEnabledUsers(ctx context.Context, req *pb.ListEnabl
 | 
			
		||||
 | 
			
		||||
// FindEnabledUser 查询单个用户信息
 | 
			
		||||
func (this *UserService) FindEnabledUser(ctx context.Context, req *pb.FindEnabledUserRequest) (*pb.FindEnabledUserResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -337,7 +337,7 @@ func (this *UserService) CheckUserUsername(ctx context.Context, req *pb.CheckUse
 | 
			
		||||
 | 
			
		||||
// LoginUser 登录
 | 
			
		||||
func (this *UserService) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error) {
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -382,7 +382,7 @@ func (this *UserService) LoginUser(ctx context.Context, req *pb.LoginUserRequest
 | 
			
		||||
 | 
			
		||||
// UpdateUserInfo 修改用户基本信息
 | 
			
		||||
func (this *UserService) UpdateUserInfo(ctx context.Context, req *pb.UpdateUserInfoRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -402,7 +402,7 @@ func (this *UserService) UpdateUserInfo(ctx context.Context, req *pb.UpdateUserI
 | 
			
		||||
 | 
			
		||||
// UpdateUserLogin 修改用户登录信息
 | 
			
		||||
func (this *UserService) UpdateUserLogin(ctx context.Context, req *pb.UpdateUserLoginRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -422,7 +422,7 @@ func (this *UserService) UpdateUserLogin(ctx context.Context, req *pb.UpdateUser
 | 
			
		||||
 | 
			
		||||
// ComposeUserDashboard 取得用户Dashboard数据
 | 
			
		||||
func (this *UserService) ComposeUserDashboard(ctx context.Context, req *pb.ComposeUserDashboardRequest) (*pb.ComposeUserDashboardResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -519,7 +519,7 @@ func (this *UserService) ComposeUserDashboard(ctx context.Context, req *pb.Compo
 | 
			
		||||
 | 
			
		||||
// FindUserNodeClusterId 获取用户所在的集群ID
 | 
			
		||||
func (this *UserService) FindUserNodeClusterId(ctx context.Context, req *pb.FindUserNodeClusterIdRequest) (*pb.FindUserNodeClusterIdResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -575,7 +575,7 @@ func (this *UserService) UpdateAllUsersFeatures(ctx context.Context, req *pb.Upd
 | 
			
		||||
 | 
			
		||||
// FindUserFeatures 获取用户所有的功能列表
 | 
			
		||||
func (this *UserService) FindUserFeatures(ctx context.Context, req *pb.FindUserFeaturesRequest) (*pb.FindUserFeaturesResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -737,7 +737,7 @@ func (this *UserService) ComposeUserGlobalBoard(ctx context.Context, req *pb.Com
 | 
			
		||||
 | 
			
		||||
// CheckUserOTPWithUsername 检查是否需要输入OTP
 | 
			
		||||
func (this *UserService) CheckUserOTPWithUsername(ctx context.Context, req *pb.CheckUserOTPWithUsernameRequest) (*pb.CheckUserOTPWithUsernameResponse, error) {
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ type UserAccessKeyService struct {
 | 
			
		||||
 | 
			
		||||
// CreateUserAccessKey 创建AccessKey
 | 
			
		||||
func (this *UserAccessKeyService) CreateUserAccessKey(ctx context.Context, req *pb.CreateUserAccessKeyRequest) (*pb.CreateUserAccessKeyResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -32,7 +32,7 @@ func (this *UserAccessKeyService) CreateUserAccessKey(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// FindAllEnabledUserAccessKeys 查找所有的AccessKey
 | 
			
		||||
func (this *UserAccessKeyService) FindAllEnabledUserAccessKeys(ctx context.Context, req *pb.FindAllEnabledUserAccessKeysRequest) (*pb.FindAllEnabledUserAccessKeysResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -66,7 +66,7 @@ func (this *UserAccessKeyService) FindAllEnabledUserAccessKeys(ctx context.Conte
 | 
			
		||||
 | 
			
		||||
// DeleteUserAccessKey 删除AccessKey
 | 
			
		||||
func (this *UserAccessKeyService) DeleteUserAccessKey(ctx context.Context, req *pb.DeleteUserAccessKeyRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -92,7 +92,7 @@ func (this *UserAccessKeyService) DeleteUserAccessKey(ctx context.Context, req *
 | 
			
		||||
 | 
			
		||||
// UpdateUserAccessKeyIsOn 设置是否启用AccessKey
 | 
			
		||||
func (this *UserAccessKeyService) UpdateUserAccessKeyIsOn(ctx context.Context, req *pb.UpdateUserAccessKeyIsOnRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -118,7 +118,7 @@ func (this *UserAccessKeyService) UpdateUserAccessKeyIsOn(ctx context.Context, r
 | 
			
		||||
 | 
			
		||||
// CountAllEnabledUserAccessKeys 计算AccessKey数量
 | 
			
		||||
func (this *UserAccessKeyService) CountAllEnabledUserAccessKeys(ctx context.Context, req *pb.CountAllEnabledUserAccessKeysRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ func (this *UserBillService) GenerateAllUserBills(ctx context.Context, req *pb.G
 | 
			
		||||
 | 
			
		||||
// CountAllUserBills 计算所有账单数量
 | 
			
		||||
func (this *UserBillService) CountAllUserBills(ctx context.Context, req *pb.CountAllUserBillsRequest) (*pb.RPCCountResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -64,7 +64,7 @@ func (this *UserBillService) CountAllUserBills(ctx context.Context, req *pb.Coun
 | 
			
		||||
 | 
			
		||||
// ListUserBills 列出单页账单
 | 
			
		||||
func (this *UserBillService) ListUserBills(ctx context.Context, req *pb.ListUserBillsRequest) (*pb.ListUserBillsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -112,7 +112,7 @@ func (this *UserBillService) ListUserBills(ctx context.Context, req *pb.ListUser
 | 
			
		||||
 | 
			
		||||
// FindUserBill 查找账单信息
 | 
			
		||||
func (this *UserBillService) FindUserBill(ctx context.Context, req *pb.FindUserBillRequest) (*pb.FindUserBillResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -169,7 +169,7 @@ func (this *UserBillService) FindUserBill(ctx context.Context, req *pb.FindUserB
 | 
			
		||||
 | 
			
		||||
// PayUserBill 支付账单
 | 
			
		||||
func (this *UserBillService) PayUserBill(ctx context.Context, req *pb.PayUserBillRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -237,7 +237,7 @@ func (this *UserBillService) PayUserBill(ctx context.Context, req *pb.PayUserBil
 | 
			
		||||
 | 
			
		||||
// SumUserUnpaidBills 计算用户所有未支付账单总额
 | 
			
		||||
func (this *UserBillService) SumUserUnpaidBills(ctx context.Context, req *pb.SumUserUnpaidBillsRequest) (*pb.SumUserUnpaidBillsResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ type UserIdentityService struct {
 | 
			
		||||
 | 
			
		||||
// CreateUserIdentity 创建身份认证信息
 | 
			
		||||
func (this *UserIdentityService) CreateUserIdentity(ctx context.Context, req *pb.CreateUserIdentityRequest) (*pb.CreateUserIdentityResponse, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -46,7 +46,7 @@ func (this *UserIdentityService) CreateUserIdentity(ctx context.Context, req *pb
 | 
			
		||||
 | 
			
		||||
// FindEnabledUserIdentity 查找单个身份认证信息
 | 
			
		||||
func (this *UserIdentityService) FindEnabledUserIdentity(ctx context.Context, req *pb.FindEnabledUserIdentityRequest) (*pb.FindEnabledUserIdentityResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -89,7 +89,7 @@ func (this *UserIdentityService) FindEnabledUserIdentity(ctx context.Context, re
 | 
			
		||||
 | 
			
		||||
// FindEnabledUserIdentityWithOrgType 查看最新的身份认证信息
 | 
			
		||||
func (this *UserIdentityService) FindEnabledUserIdentityWithOrgType(ctx context.Context, req *pb.FindEnabledUserIdentityWithOrgTypeRequest) (*pb.FindEnabledUserIdentityWithOrgTypeResponse, error) {
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx)
 | 
			
		||||
	_, userId, err := this.ValidateAdminAndUser(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -145,7 +145,7 @@ func (this *UserIdentityService) CheckUserIdentityIsSubmitted(ctx context.Contex
 | 
			
		||||
 | 
			
		||||
// UpdateUserIdentity 修改身份认证信息
 | 
			
		||||
func (this *UserIdentityService) UpdateUserIdentity(ctx context.Context, req *pb.UpdateUserIdentityRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -194,7 +194,7 @@ func (this *UserIdentityService) UpdateUserIdentity(ctx context.Context, req *pb
 | 
			
		||||
 | 
			
		||||
// SubmitUserIdentity 提交审核身份认证信息
 | 
			
		||||
func (this *UserIdentityService) SubmitUserIdentity(ctx context.Context, req *pb.SubmitUserIdentityRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
@@ -226,7 +226,7 @@ func (this *UserIdentityService) SubmitUserIdentity(ctx context.Context, req *pb
 | 
			
		||||
 | 
			
		||||
// CancelUserIdentity 取消提交身份审核认证信息
 | 
			
		||||
func (this *UserIdentityService) CancelUserIdentity(ctx context.Context, req *pb.CancelUserIdentityRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	userId, err := this.ValidateUserNode(ctx, true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,7 @@ func (this *UserNodeService) FindEnabledUserNode(ctx context.Context, req *pb.Fi
 | 
			
		||||
 | 
			
		||||
// FindCurrentUserNode 获取当前用户节点的版本
 | 
			
		||||
func (this *UserNodeService) FindCurrentUserNode(ctx context.Context, req *pb.FindCurrentUserNodeRequest) (*pb.FindCurrentUserNodeResponse, error) {
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx)
 | 
			
		||||
	_, err := this.ValidateUserNode(ctx, false)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user