001/*-
002 * #%L
003 * HAPI FHIR - Server Framework
004 * %%
005 * Copyright (C) 2014 - 2024 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.rest.server.interceptor.auth;
021
022import jakarta.annotation.Nonnull;
023import org.hl7.fhir.instance.model.api.IIdType;
024
025/**
026 * @since 5.5.0
027 */
028public interface IAuthRuleBuilderRuleBulkExport {
029
030        /**
031         * Allow/deny <b>group-level</b> export rule applies to the Group with the given resource ID, e.g. <code>Group/123</code>
032         *
033         * @since 5.5.0
034         */
035        default IAuthRuleBuilderRuleBulkExportWithTarget groupExportOnGroup(@Nonnull IIdType theFocusResourceId) {
036                return groupExportOnGroup(theFocusResourceId.getValue());
037        }
038
039        /**
040         * Allow/deny <b>group-level</b> export rule applies to the Group with the given resource ID, e.g. <code>Group/123</code>
041         *
042         * @since 5.5.0
043         */
044        IAuthRuleBuilderRuleBulkExportWithTarget groupExportOnGroup(@Nonnull String theFocusResourceId);
045
046        /**
047         * Allow/deny <b>patient-level</b> export rule applies to the Group with the given resource ID, e.g. <code>Group/123</code>
048         *
049         * @since 5.5.0
050         */
051        default IAuthRuleBuilderRuleBulkExportWithTarget patientExportOnGroup(@Nonnull IIdType theFocusResourceId) {
052                return patientExportOnGroup(theFocusResourceId.getValue());
053        }
054
055        IAuthRuleBuilderRuleBulkExportWithTarget patientExportOnPatient(@Nonnull String theFocusResourceId);
056
057        default IAuthRuleBuilderRuleBulkExportWithTarget patientExportOnPatient(@Nonnull IIdType theFocusResourceId) {
058                return patientExportOnPatient(theFocusResourceId.getValue());
059        }
060
061        /**
062         * Allow/deny <b>patient-level</b> export rule applies to the Group with the given resource ID, e.g. <code>Group/123</code>
063         *
064         * @since 5.5.0
065         */
066        IAuthRuleBuilderRuleBulkExportWithTarget patientExportOnGroup(@Nonnull String theFocusResourceId);
067
068        /**
069         * Allow/deny <b>system-level</b> export rule applies to the Group with the given resource ID, e.g. <code>Group/123</code>
070         *
071         * @since 5.5.0
072         */
073        IAuthRuleBuilderRuleBulkExportWithTarget systemExport();
074
075        /**
076         * Allow/deny <b>any bulk export</b> operation
077         */
078        IAuthRuleBuilderRuleBulkExportWithTarget any();
079}