001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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.accounting.server.graphql; 018 019import com.echothree.control.user.accounting.server.command.GetCurrenciesCommand; 020import com.echothree.control.user.accounting.server.command.GetCurrencyCommand; 021import com.echothree.control.user.accounting.server.command.GetGlAccountCategoriesCommand; 022import com.echothree.control.user.accounting.server.command.GetGlAccountCategoryCommand; 023import com.echothree.control.user.accounting.server.command.GetGlAccountClassCommand; 024import com.echothree.control.user.accounting.server.command.GetGlAccountClassesCommand; 025import com.echothree.control.user.accounting.server.command.GetGlAccountCommand; 026import com.echothree.control.user.accounting.server.command.GetGlAccountTypeCommand; 027import com.echothree.control.user.accounting.server.command.GetGlAccountTypesCommand; 028import com.echothree.control.user.accounting.server.command.GetGlAccountsCommand; 029import com.echothree.control.user.accounting.server.command.GetGlResourceTypeCommand; 030import com.echothree.control.user.accounting.server.command.GetGlResourceTypesCommand; 031import com.echothree.control.user.accounting.server.command.GetItemAccountingCategoriesCommand; 032import com.echothree.control.user.accounting.server.command.GetItemAccountingCategoryCommand; 033import com.echothree.control.user.accounting.server.command.GetSymbolPositionCommand; 034import com.echothree.control.user.accounting.server.command.GetSymbolPositionsCommand; 035import com.echothree.control.user.accounting.server.command.GetTransactionCommand; 036import com.echothree.control.user.accounting.server.command.GetTransactionEntityRoleTypeCommand; 037import com.echothree.control.user.accounting.server.command.GetTransactionEntityRoleTypesCommand; 038import com.echothree.control.user.accounting.server.command.GetTransactionGlAccountCategoriesCommand; 039import com.echothree.control.user.accounting.server.command.GetTransactionGlAccountCategoryCommand; 040import com.echothree.control.user.accounting.server.command.GetTransactionGroupCommand; 041import com.echothree.control.user.accounting.server.command.GetTransactionGroupsCommand; 042import com.echothree.control.user.accounting.server.command.GetTransactionTimeTypeCommand; 043import com.echothree.control.user.accounting.server.command.GetTransactionTimeTypesCommand; 044import com.echothree.control.user.accounting.server.command.GetTransactionTypeCommand; 045import com.echothree.control.user.accounting.server.command.GetTransactionTypesCommand; 046import com.echothree.control.user.accounting.server.command.GetTransactionsCommand; 047import com.echothree.model.control.graphql.server.util.BaseGraphQl; 048import graphql.schema.DataFetchingEnvironment; 049 050public interface AccountingSecurityUtils { 051 052 static boolean getHasSymbolPositionAccess(final DataFetchingEnvironment env) { 053 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetSymbolPositionCommand.class); 054 } 055 056 static boolean getHasSymbolPositionsAccess(final DataFetchingEnvironment env) { 057 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetSymbolPositionsCommand.class); 058 } 059 060 static boolean getHasCurrencyAccess(final DataFetchingEnvironment env) { 061 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCurrencyCommand.class); 062 } 063 064 static boolean getHasCurrenciesAccess(final DataFetchingEnvironment env) { 065 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCurrenciesCommand.class); 066 } 067 068 static boolean getHasItemAccountingCategoryAccess(final DataFetchingEnvironment env) { 069 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetItemAccountingCategoryCommand.class); 070 } 071 072 static boolean getHasItemAccountingCategoriesAccess(final DataFetchingEnvironment env) { 073 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetItemAccountingCategoriesCommand.class); 074 } 075 076 static boolean getHasGlAccountAccess(final DataFetchingEnvironment env) { 077 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountCommand.class); 078 } 079 080 static boolean getHasGlAccountsAccess(final DataFetchingEnvironment env) { 081 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountsCommand.class); 082 } 083 084 static boolean getHasGlAccountTypeAccess(final DataFetchingEnvironment env) { 085 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountTypeCommand.class); 086 } 087 088 static boolean getHasGlAccountTypesAccess(final DataFetchingEnvironment env) { 089 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountTypesCommand.class); 090 } 091 092 static boolean getHasGlAccountClassAccess(final DataFetchingEnvironment env) { 093 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountClassCommand.class); 094 } 095 096 static boolean getHasGlAccountClassesAccess(final DataFetchingEnvironment env) { 097 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountClassesCommand.class); 098 } 099 100 static boolean getHasGlAccountCategoryAccess(final DataFetchingEnvironment env) { 101 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountCategoryCommand.class); 102 } 103 104 static boolean getHasGlAccountCategoriesAccess(final DataFetchingEnvironment env) { 105 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlAccountCategoriesCommand.class); 106 } 107 108 static boolean getHasGlResourceTypeAccess(final DataFetchingEnvironment env) { 109 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlResourceTypeCommand.class); 110 } 111 112 static boolean getHasGlResourceTypesAccess(final DataFetchingEnvironment env) { 113 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetGlResourceTypesCommand.class); 114 } 115 116 static boolean getHasTransactionTimeTypeAccess(final DataFetchingEnvironment env) { 117 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionTimeTypeCommand.class); 118 } 119 120 static boolean getHasTransactionTimeTypesAccess(final DataFetchingEnvironment env) { 121 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionTimeTypesCommand.class); 122 } 123 124 static boolean getHasTransactionTypeAccess(final DataFetchingEnvironment env) { 125 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionTypeCommand.class); 126 } 127 128 static boolean getHasTransactionTypesAccess(final DataFetchingEnvironment env) { 129 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionTypesCommand.class); 130 } 131 132 static boolean getHasTransactionGlAccountCategoryAccess(final DataFetchingEnvironment env) { 133 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionGlAccountCategoryCommand.class); 134 } 135 136 static boolean getHasTransactionGlAccountCategoriesAccess(final DataFetchingEnvironment env) { 137 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionGlAccountCategoriesCommand.class); 138 } 139 140 static boolean getHasTransactionEntityRoleTypeAccess(final DataFetchingEnvironment env) { 141 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionEntityRoleTypeCommand.class); 142 } 143 144 static boolean getHasTransactionEntityRoleTypesAccess(final DataFetchingEnvironment env) { 145 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionEntityRoleTypesCommand.class); 146 } 147 148 static boolean getHasTransactionAccess(final DataFetchingEnvironment env) { 149 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionCommand.class); 150 } 151 152 static boolean getHasTransactionsAccess(final DataFetchingEnvironment env) { 153 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionsCommand.class); 154 } 155 156 static boolean getHasTransactionGroupAccess(final DataFetchingEnvironment env) { 157 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionGroupCommand.class); 158 } 159 160 static boolean getHasTransactionGroupsAccess(final DataFetchingEnvironment env) { 161 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetTransactionGroupsCommand.class); 162 } 163 164}