001package ca.uhn.fhir.rest.server.exceptions;
002
003import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
004
005import ca.uhn.fhir.rest.server.Constants;
006import ca.uhn.fhir.util.CoverageIgnore;
007
008/*
009 * #%L
010 * HAPI FHIR - Core Library
011 * %%
012 * Copyright (C) 2014 - 2016 University Health Network
013 * %%
014 * Licensed under the Apache License, Version 2.0 (the "License");
015 * you may not use this file except in compliance with the License.
016 * You may obtain a copy of the License at
017 * 
018 *      http://www.apache.org/licenses/LICENSE-2.0
019 * 
020 * Unless required by applicable law or agreed to in writing, software
021 * distributed under the License is distributed on an "AS IS" BASIS,
022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
023 * See the License for the specific language governing permissions and
024 * limitations under the License.
025 * #L%
026 */
027
028/**
029 * This Represents an <b>HTTP 403 Forbidden</b> response, which generally indicates one of two conditions:
030 * <ul>
031 * <li>Authentication was provided, but the authenticated user is not permitted to perform the requested operation.</li>
032 * <li>The operation is forbidden to all users. Repeating the request with authentication would serve no purpose.</li>
033 * </ul>
034 * 
035 * <p>
036 * Note that a complete list of RESTful exceptions is available in the <a href="./package-summary.html">Package
037 * Summary</a>.
038 * </p>
039 */
040@CoverageIgnore
041public class ForbiddenOperationException extends BaseServerResponseException {
042
043        public static final int STATUS_CODE = Constants.STATUS_HTTP_403_FORBIDDEN;
044        private static final long serialVersionUID = 1L;
045
046        public ForbiddenOperationException(String theMessage) {
047                super(STATUS_CODE, theMessage);
048        }
049
050        /**
051         * Constructor
052         * 
053         * @param theMessage
054         *            The message
055         * @param theOperationOutcome
056         *            The OperationOutcome resource to return to the client
057         */
058        public ForbiddenOperationException(String theMessage, IBaseOperationOutcome theOperationOutcome) {
059                super(STATUS_CODE, theMessage, theOperationOutcome);
060        }
061
062}