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.chain.server.graphql; 018 019import com.echothree.control.user.chain.server.command.GetChainActionCommand; 020import com.echothree.control.user.chain.server.command.GetChainActionSetCommand; 021import com.echothree.control.user.chain.server.command.GetChainActionSetsCommand; 022import com.echothree.control.user.chain.server.command.GetChainActionTypeCommand; 023import com.echothree.control.user.chain.server.command.GetChainActionTypesCommand; 024import com.echothree.control.user.chain.server.command.GetChainActionsCommand; 025import com.echothree.control.user.chain.server.command.GetChainCommand; 026import com.echothree.control.user.chain.server.command.GetChainEntityRoleTypeCommand; 027import com.echothree.control.user.chain.server.command.GetChainEntityRoleTypesCommand; 028import com.echothree.control.user.chain.server.command.GetChainInstanceCommand; 029import com.echothree.control.user.chain.server.command.GetChainInstancesCommand; 030import com.echothree.control.user.chain.server.command.GetChainKindCommand; 031import com.echothree.control.user.chain.server.command.GetChainKindsCommand; 032import com.echothree.control.user.chain.server.command.GetChainTypeCommand; 033import com.echothree.control.user.chain.server.command.GetChainTypesCommand; 034import com.echothree.control.user.chain.server.command.GetChainsCommand; 035import com.echothree.model.control.graphql.server.util.BaseGraphQl; 036import graphql.schema.DataFetchingEnvironment; 037 038public interface ChainSecurityUtils { 039 040 static boolean getHasChainKindsAccess(final DataFetchingEnvironment env) { 041 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainKindsCommand.class); 042 } 043 044 static boolean getHasChainKindAccess(final DataFetchingEnvironment env) { 045 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainKindCommand.class); 046 } 047 048 static boolean getHasChainTypesAccess(final DataFetchingEnvironment env) { 049 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainTypesCommand.class); 050 } 051 052 static boolean getHasChainTypeAccess(final DataFetchingEnvironment env) { 053 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainTypeCommand.class); 054 } 055 056 static boolean getHasChainsAccess(final DataFetchingEnvironment env) { 057 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainsCommand.class); 058 } 059 060 static boolean getHasChainAccess(final DataFetchingEnvironment env) { 061 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainCommand.class); 062 } 063 064 static boolean getHasChainActionSetsAccess(final DataFetchingEnvironment env) { 065 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionSetsCommand.class); 066 } 067 068 static boolean getHasChainActionSetAccess(final DataFetchingEnvironment env) { 069 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionSetCommand.class); 070 } 071 072 static boolean getHasChainActionTypesAccess(final DataFetchingEnvironment env) { 073 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionTypesCommand.class); 074 } 075 076 static boolean getHasChainActionTypeAccess(final DataFetchingEnvironment env) { 077 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionTypeCommand.class); 078 } 079 080 static boolean getHasChainActionsAccess(final DataFetchingEnvironment env) { 081 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionsCommand.class); 082 } 083 084 static boolean getHasChainActionAccess(final DataFetchingEnvironment env) { 085 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainActionCommand.class); 086 } 087 088 static boolean getHasChainInstancesAccess(final DataFetchingEnvironment env) { 089 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainInstancesCommand.class); 090 } 091 092 static boolean getHasChainInstanceAccess(final DataFetchingEnvironment env) { 093 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainInstanceCommand.class); 094 } 095 096 static boolean getHasChainEntityRoleTypesAccess(final DataFetchingEnvironment env) { 097 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainEntityRoleTypesCommand.class); 098 } 099 100 static boolean getHasChainEntityRoleTypeAccess(final DataFetchingEnvironment env) { 101 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetChainEntityRoleTypeCommand.class); 102 } 103 104}