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.contactlist.server.graphql;
018
019import com.echothree.control.user.contactlist.server.command.GetContactListCommand;
020import com.echothree.control.user.contactlist.server.command.GetContactListContactMechanismPurposeCommand;
021import com.echothree.control.user.contactlist.server.command.GetContactListContactMechanismPurposesCommand;
022import com.echothree.control.user.contactlist.server.command.GetContactListFrequenciesCommand;
023import com.echothree.control.user.contactlist.server.command.GetContactListFrequencyCommand;
024import com.echothree.control.user.contactlist.server.command.GetContactListGroupCommand;
025import com.echothree.control.user.contactlist.server.command.GetContactListGroupsCommand;
026import com.echothree.control.user.contactlist.server.command.GetContactListTypeCommand;
027import com.echothree.control.user.contactlist.server.command.GetContactListTypesCommand;
028import com.echothree.control.user.contactlist.server.command.GetContactListsCommand;
029import com.echothree.control.user.contactlist.server.command.GetCustomerTypeContactListCommand;
030import com.echothree.control.user.contactlist.server.command.GetCustomerTypeContactListGroupCommand;
031import com.echothree.control.user.contactlist.server.command.GetCustomerTypeContactListGroupsCommand;
032import com.echothree.control.user.contactlist.server.command.GetCustomerTypeContactListsCommand;
033import com.echothree.control.user.contactlist.server.command.GetPartyContactListCommand;
034import com.echothree.control.user.contactlist.server.command.GetPartyContactListsCommand;
035import com.echothree.control.user.contactlist.server.command.GetPartyTypeContactListCommand;
036import com.echothree.control.user.contactlist.server.command.GetPartyTypeContactListGroupCommand;
037import com.echothree.control.user.contactlist.server.command.GetPartyTypeContactListGroupsCommand;
038import com.echothree.control.user.contactlist.server.command.GetPartyTypeContactListsCommand;
039import com.echothree.model.control.graphql.server.util.BaseGraphQl;
040import graphql.schema.DataFetchingEnvironment;
041
042public interface ContactListSecurityUtils {
043
044    static boolean getHasContactListTypesAccess(final DataFetchingEnvironment env) {
045        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListTypesCommand.class);
046    }
047
048    static boolean getHasContactListTypeAccess(final DataFetchingEnvironment env) {
049        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListTypeCommand.class);
050    }
051
052    static boolean getHasContactListGroupsAccess(final DataFetchingEnvironment env) {
053        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListGroupsCommand.class);
054    }
055
056    static boolean getHasContactListGroupAccess(final DataFetchingEnvironment env) {
057        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListGroupCommand.class);
058    }
059
060    static boolean getHasContactListFrequenciesAccess(final DataFetchingEnvironment env) {
061        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListFrequenciesCommand.class);
062    }
063
064    static boolean getHasContactListFrequencyAccess(final DataFetchingEnvironment env) {
065        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListFrequencyCommand.class);
066    }
067
068    static boolean getHasContactListsAccess(final DataFetchingEnvironment env) {
069        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListsCommand.class);
070    }
071
072    static boolean getHasContactListAccess(final DataFetchingEnvironment env) {
073        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListCommand.class);
074    }
075
076    static boolean getHasPartyTypeContactListGroupsAccess(final DataFetchingEnvironment env) {
077        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyTypeContactListGroupsCommand.class);
078    }
079
080    static boolean getHasPartyTypeContactListGroupAccess(final DataFetchingEnvironment env) {
081        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyTypeContactListGroupCommand.class);
082    }
083
084    static boolean getHasCustomerTypeContactListGroupsAccess(final DataFetchingEnvironment env) {
085        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCustomerTypeContactListGroupsCommand.class);
086    }
087
088    static boolean getHasCustomerTypeContactListGroupAccess(final DataFetchingEnvironment env) {
089        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCustomerTypeContactListGroupCommand.class);
090    }
091
092    static boolean getHasPartyTypeContactListsAccess(final DataFetchingEnvironment env) {
093        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyTypeContactListsCommand.class);
094    }
095
096    static boolean getHasPartyTypeContactListAccess(final DataFetchingEnvironment env) {
097        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyTypeContactListCommand.class);
098    }
099
100    static boolean getHasPartyContactListsAccess(final DataFetchingEnvironment env) {
101        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyContactListsCommand.class);
102    }
103
104    static boolean getHasPartyContactListAccess(final DataFetchingEnvironment env) {
105        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetPartyContactListCommand.class);
106    }
107
108    static boolean getHasCustomerTypeContactListsAccess(final DataFetchingEnvironment env) {
109        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCustomerTypeContactListsCommand.class);
110    }
111
112    static boolean getHasCustomerTypeContactListAccess(final DataFetchingEnvironment env) {
113        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCustomerTypeContactListCommand.class);
114    }
115
116    static boolean getHasContactListContactMechanismPurposesAccess(final DataFetchingEnvironment env) {
117        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListContactMechanismPurposesCommand.class);
118    }
119
120    static boolean getHasContactListContactMechanismPurposeAccess(final DataFetchingEnvironment env) {
121        return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetContactListContactMechanismPurposeCommand.class);
122    }
123
124}