SLING-6674 Context-Aware Config: Separate exception when persist failes due to missing access rights

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1787777 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java
new file mode 100644
index 0000000..a152808
--- /dev/null
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceAccessDeniedException.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.caconfig.spi;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Is thrown when configuration cannot be persisted because the user is not allowed to write to repository.
+ */
+@ProviderType
+public final class ConfigurationPersistenceAccessDeniedException extends ConfigurationPersistenceException {
+    private static final long serialVersionUID = 1L;
+
+    public ConfigurationPersistenceAccessDeniedException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ConfigurationPersistenceAccessDeniedException(String message) {
+        super(message);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
index 207162f..c800e00 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/ConfigurationPersistenceException.java
@@ -24,7 +24,7 @@
  * Is thrown when configuration cannot be persisted.
  */
 @ProviderType
-public final class ConfigurationPersistenceException extends RuntimeException {
+public class ConfigurationPersistenceException extends RuntimeException {
     private static final long serialVersionUID = 1L;
 
     public ConfigurationPersistenceException(String message, Throwable cause) {