001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016 017package com.echothree.model.control.payment.server.graphql; 018 019import com.echothree.control.user.payment.server.command.GetPaymentMethodCommand; 020import com.echothree.control.user.payment.server.command.GetPaymentMethodTypeCommand; 021import com.echothree.control.user.payment.server.command.GetPaymentMethodTypesCommand; 022import com.echothree.control.user.payment.server.command.GetPaymentMethodsCommand; 023import com.echothree.control.user.payment.server.command.GetPaymentProcessorActionTypeCommand; 024import com.echothree.control.user.payment.server.command.GetPaymentProcessorCommand; 025import com.echothree.control.user.payment.server.command.GetPaymentProcessorResultCodeCommand; 026import com.echothree.control.user.payment.server.command.GetPaymentProcessorTransactionCodesCommand; 027import com.echothree.control.user.payment.server.command.GetPaymentProcessorTransactionCommand; 028import com.echothree.control.user.payment.server.command.GetPaymentProcessorTransactionsCommand; 029import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCodeCommand; 030import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCodeTypeCommand; 031import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypeCommand; 032import com.echothree.control.user.payment.server.command.GetPaymentProcessorTypesCommand; 033import com.echothree.control.user.payment.server.command.GetPaymentProcessorsCommand; 034import com.echothree.control.user.shipping.server.command.GetShippingMethodCommand; 035import com.echothree.control.user.shipping.server.command.GetShippingMethodsCommand; 036import com.echothree.model.control.graphql.server.util.BaseGraphQl; 037import graphql.schema.DataFetchingEnvironment; 038 039public interface PaymentSecurityUtils { 040 041 static boolean getHasPaymentMethodTypeAccess(final DataFetchingEnvironment env) { 042 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentMethodTypeCommand.class); 043 } 044 045 static boolean getHasPaymentMethodTypesAccess(final DataFetchingEnvironment env) { 046 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentMethodTypesCommand.class); 047 } 048 049 static boolean getHasPaymentMethodAccess(final DataFetchingEnvironment env) { 050 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentMethodCommand.class); 051 } 052 053 static boolean getHasPaymentMethodsAccess(final DataFetchingEnvironment env) { 054 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentMethodsCommand.class); 055 } 056 057 static boolean getHasPaymentProcessorTypeAccess(final DataFetchingEnvironment env) { 058 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTypeCommand.class); 059 } 060 061 static boolean getHasPaymentProcessorTypesAccess(final DataFetchingEnvironment env) { 062 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTypesCommand.class); 063 } 064 065 static boolean getHasPaymentProcessorAccess(final DataFetchingEnvironment env) { 066 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorCommand.class); 067 } 068 069 static boolean getHasPaymentProcessorsAccess(final DataFetchingEnvironment env) { 070 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorsCommand.class); 071 } 072 073 static boolean getHasPaymentProcessorTransactionsAccess(final DataFetchingEnvironment env) { 074 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTransactionsCommand.class); 075 } 076 077 static boolean getHasPaymentProcessorTransactionAccess(final DataFetchingEnvironment env) { 078 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTransactionCommand.class); 079 } 080 081 static boolean getHasPaymentProcessorTypeCodeAccess(final DataFetchingEnvironment env) { 082 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTypeCodeCommand.class); 083 } 084 085 static boolean getHasPaymentProcessorTransactionCodesAccess(final DataFetchingEnvironment env) { 086 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTransactionCodesCommand.class); 087 } 088 089 static boolean getHasPaymentProcessorActionTypeAccess(final DataFetchingEnvironment env) { 090 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorActionTypeCommand.class); 091 } 092 093 static boolean getHasPaymentProcessorResultCodeAccess(final DataFetchingEnvironment env) { 094 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorResultCodeCommand.class); 095 } 096 097 static boolean getHasPaymentProcessorTypeCodeTypeAccess(final DataFetchingEnvironment env) { 098 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPaymentProcessorTypeCodeTypeCommand.class); 099 } 100 101}