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.campaign.server.graphql; 018 019import com.echothree.control.user.campaign.server.command.GetCampaignCommand; 020import com.echothree.control.user.campaign.server.command.GetCampaignContentCommand; 021import com.echothree.control.user.campaign.server.command.GetCampaignContentsCommand; 022import com.echothree.control.user.campaign.server.command.GetCampaignMediumCommand; 023import com.echothree.control.user.campaign.server.command.GetCampaignMediumsCommand; 024import com.echothree.control.user.campaign.server.command.GetCampaignSourceCommand; 025import com.echothree.control.user.campaign.server.command.GetCampaignSourcesCommand; 026import com.echothree.control.user.campaign.server.command.GetCampaignTermCommand; 027import com.echothree.control.user.campaign.server.command.GetCampaignTermsCommand; 028import com.echothree.control.user.campaign.server.command.GetCampaignsCommand; 029import com.echothree.control.user.filter.server.command.GetFilterAdjustmentAmountCommand; 030import com.echothree.control.user.filter.server.command.GetFilterAdjustmentAmountsCommand; 031import com.echothree.control.user.filter.server.command.GetFilterAdjustmentCommand; 032import com.echothree.control.user.filter.server.command.GetFilterAdjustmentFixedAmountCommand; 033import com.echothree.control.user.filter.server.command.GetFilterAdjustmentFixedAmountsCommand; 034import com.echothree.control.user.filter.server.command.GetFilterAdjustmentPercentCommand; 035import com.echothree.control.user.filter.server.command.GetFilterAdjustmentPercentsCommand; 036import com.echothree.control.user.filter.server.command.GetFilterAdjustmentSourceCommand; 037import com.echothree.control.user.filter.server.command.GetFilterAdjustmentTypeCommand; 038import com.echothree.control.user.filter.server.command.GetFilterAdjustmentsCommand; 039import com.echothree.control.user.filter.server.command.GetFilterCommand; 040import com.echothree.control.user.filter.server.command.GetFilterEntranceStepCommand; 041import com.echothree.control.user.filter.server.command.GetFilterEntranceStepsCommand; 042import com.echothree.control.user.filter.server.command.GetFilterKindCommand; 043import com.echothree.control.user.filter.server.command.GetFilterStepCommand; 044import com.echothree.control.user.filter.server.command.GetFilterStepDestinationCommand; 045import com.echothree.control.user.filter.server.command.GetFilterStepDestinationsCommand; 046import com.echothree.control.user.filter.server.command.GetFilterStepElementCommand; 047import com.echothree.control.user.filter.server.command.GetFilterStepElementsCommand; 048import com.echothree.control.user.filter.server.command.GetFilterStepsCommand; 049import com.echothree.control.user.filter.server.command.GetFilterTypeCommand; 050import com.echothree.control.user.filter.server.command.GetFilterTypesCommand; 051import com.echothree.control.user.filter.server.command.GetFiltersCommand; 052import com.echothree.model.control.graphql.server.util.BaseGraphQl; 053import graphql.schema.DataFetchingEnvironment; 054 055public interface CampaignSecurityUtils { 056 057 static boolean getHasCampaignAccess(final DataFetchingEnvironment env) { 058 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignCommand.class); 059 } 060 061 static boolean getHasCampaignsAccess(final DataFetchingEnvironment env) { 062 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignsCommand.class); 063 } 064 065 static boolean getHasCampaignSourceAccess(final DataFetchingEnvironment env) { 066 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignSourceCommand.class); 067 } 068 069 static boolean getHasCampaignSourcesAccess(final DataFetchingEnvironment env) { 070 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignSourcesCommand.class); 071 } 072 073 static boolean getHasCampaignMediumAccess(final DataFetchingEnvironment env) { 074 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignMediumCommand.class); 075 } 076 077 static boolean getHasCampaignMediumsAccess(final DataFetchingEnvironment env) { 078 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignMediumsCommand.class); 079 } 080 081 static boolean getHasCampaignTermAccess(final DataFetchingEnvironment env) { 082 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignTermCommand.class); 083 } 084 085 static boolean getHasCampaignTermsAccess(final DataFetchingEnvironment env) { 086 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignTermsCommand.class); 087 } 088 089 static boolean getHasCampaignContentAccess(final DataFetchingEnvironment env) { 090 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignContentCommand.class); 091 } 092 093 static boolean getHasCampaignContentsAccess(final DataFetchingEnvironment env) { 094 return BaseGraphQl.getGraphQlExecutionContext(env).hasAccess(GetCampaignContentsCommand.class); 095 } 096 097}