001// --------------------------------------------------------------------------------
002// Copyright 2002-2024 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.workflow.server.graphql;
018
019import com.echothree.control.user.workflow.server.command.GetWorkflowCommand;
020import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationCommand;
021import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationPartyTypeCommand;
022import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationPartyTypesCommand;
023import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSecurityRoleCommand;
024import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSecurityRolesCommand;
025import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSelectorCommand;
026import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationSelectorsCommand;
027import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationStepCommand;
028import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationStepsCommand;
029import com.echothree.control.user.workflow.server.command.GetWorkflowDestinationsCommand;
030import com.echothree.control.user.workflow.server.command.GetWorkflowEntityStatusesCommand;
031import com.echothree.control.user.workflow.server.command.GetWorkflowEntityTypeCommand;
032import com.echothree.control.user.workflow.server.command.GetWorkflowEntityTypesCommand;
033import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceCommand;
034import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancePartyTypeCommand;
035import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancePartyTypesCommand;
036import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSecurityRoleCommand;
037import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSecurityRolesCommand;
038import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSelectorCommand;
039import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceSelectorsCommand;
040import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceStepCommand;
041import com.echothree.control.user.workflow.server.command.GetWorkflowEntranceStepsCommand;
042import com.echothree.control.user.workflow.server.command.GetWorkflowEntrancesCommand;
043import com.echothree.control.user.workflow.server.command.GetWorkflowSelectorKindCommand;
044import com.echothree.control.user.workflow.server.command.GetWorkflowSelectorKindsCommand;
045import com.echothree.control.user.workflow.server.command.GetWorkflowStepCommand;
046import com.echothree.control.user.workflow.server.command.GetWorkflowStepTypeCommand;
047import com.echothree.control.user.workflow.server.command.GetWorkflowStepTypesCommand;
048import com.echothree.control.user.workflow.server.command.GetWorkflowStepsCommand;
049import com.echothree.control.user.workflow.server.command.GetWorkflowsCommand;
050import com.echothree.model.control.graphql.server.util.BaseGraphQl;
051import graphql.schema.DataFetchingEnvironment;
052
053public interface WorkflowSecurityUtils {
054
055    static boolean getHasWorkflowsAccess(final DataFetchingEnvironment env) {
056        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowsCommand.class);
057    }
058
059    static boolean getHasWorkflowAccess(final DataFetchingEnvironment env) {
060        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowCommand.class);
061    }
062
063    static boolean getHasWorkflowStepsAccess(final DataFetchingEnvironment env) {
064        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowStepsCommand.class);
065    }
066
067    static boolean getHasWorkflowStepAccess(final DataFetchingEnvironment env) {
068        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowStepCommand.class);
069    }
070
071    static boolean getHasWorkflowStepTypesAccess(final DataFetchingEnvironment env) {
072        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowStepTypesCommand.class);
073    }
074
075    static boolean getHasWorkflowStepTypeAccess(final DataFetchingEnvironment env) {
076        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowStepTypeCommand.class);
077    }
078
079    static boolean getHasWorkflowEntityStatusesAccess(final DataFetchingEnvironment env) {
080        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntityStatusesCommand.class);
081    }
082
083    static boolean getHasWorkflowEntrancesAccess(final DataFetchingEnvironment env) {
084        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntrancesCommand.class);
085    }
086
087    static boolean getHasWorkflowEntranceAccess(final DataFetchingEnvironment env) {
088        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceCommand.class);
089    }
090
091    static boolean getHasWorkflowEntranceStepsAccess(final DataFetchingEnvironment env) {
092        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceStepsCommand.class);
093    }
094
095    static boolean getHasWorkflowEntranceStepAccess(final DataFetchingEnvironment env) {
096        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceStepCommand.class);
097    }
098
099    static boolean getHasWorkflowEntrancePartyTypesAccess(final DataFetchingEnvironment env) {
100        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntrancePartyTypesCommand.class);
101    }
102
103    static boolean getHasWorkflowEntrancePartyTypeAccess(final DataFetchingEnvironment env) {
104        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntrancePartyTypeCommand.class);
105    }
106
107    static boolean getHasWorkflowEntranceSecurityRolesAccess(final DataFetchingEnvironment env) {
108        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceSecurityRolesCommand.class);
109    }
110
111    static boolean getHasWorkflowEntranceSecurityRoleAccess(final DataFetchingEnvironment env) {
112        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceSecurityRoleCommand.class);
113    }
114
115    static boolean getHasWorkflowEntranceSelectorsAccess(final DataFetchingEnvironment env) {
116        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceSelectorsCommand.class);
117    }
118
119    static boolean getHasWorkflowEntranceSelectorAccess(final DataFetchingEnvironment env) {
120        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntranceSelectorCommand.class);
121    }
122
123    static boolean getHasWorkflowDestinationsAccess(final DataFetchingEnvironment env) {
124        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationsCommand.class);
125    }
126
127    static boolean getHasWorkflowDestinationAccess(final DataFetchingEnvironment env) {
128        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationCommand.class);
129    }
130
131    static boolean getHasWorkflowDestinationStepsAccess(final DataFetchingEnvironment env) {
132        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationStepsCommand.class);
133    }
134
135    static boolean getHasWorkflowDestinationStepAccess(final DataFetchingEnvironment env) {
136        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationStepCommand.class);
137    }
138
139    static boolean getHasWorkflowDestinationPartyTypesAccess(final DataFetchingEnvironment env) {
140        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationPartyTypesCommand.class);
141    }
142
143    static boolean getHasWorkflowDestinationPartyTypeAccess(final DataFetchingEnvironment env) {
144        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationPartyTypeCommand.class);
145    }
146
147    static boolean getHasWorkflowDestinationSecurityRolesAccess(final DataFetchingEnvironment env) {
148        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationSecurityRolesCommand.class);
149    }
150
151    static boolean getHasWorkflowDestinationSecurityRoleAccess(final DataFetchingEnvironment env) {
152        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationSecurityRoleCommand.class);
153    }
154
155    static boolean getHasWorkflowDestinationSelectorsAccess(final DataFetchingEnvironment env) {
156        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationSelectorsCommand.class);
157    }
158
159    static boolean getHasWorkflowDestinationSelectorAccess(final DataFetchingEnvironment env) {
160        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowDestinationSelectorCommand.class);
161    }
162
163    static boolean getHasWorkflowEntityTypesAccess(final DataFetchingEnvironment env) {
164        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntityTypesCommand.class);
165    }
166
167    static boolean getHasWorkflowEntityTypeAccess(final DataFetchingEnvironment env) {
168        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowEntityTypeCommand.class);
169    }
170
171    static boolean getHasWorkflowSelectorKindsAccess(final DataFetchingEnvironment env) {
172        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowSelectorKindsCommand.class);
173    }
174
175    static boolean getHasWorkflowSelectorKindAccess(final DataFetchingEnvironment env) {
176        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetWorkflowSelectorKindCommand.class);
177    }
178
179}