You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/12/14 19:39:42 UTC
svn commit: r726513 -
/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Author: fmeschbe
Date: Sun Dec 14 10:39:41 2008
New Revision: 726513
URL: http://svn.apache.org/viewvc?rev=726513&view=rev
Log:
SLING-772 Catch AccessControlException to be able to return null if permission
to set properties is denied.
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=726513&r1=726512&r2=726513&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java (original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java Sun Dec 14 10:39:41 2008
@@ -26,6 +26,7 @@
import java.io.InputStream;
import java.net.URL;
+import java.security.AccessControlException;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
@@ -88,9 +89,10 @@
try {
getNode().getSession().checkPermission(getNode().getPath(), "set_property");
return (Type) new JcrModifiablePropertyMap(getNode());
+ } catch (AccessControlException ace) {
+ // the user has no write permission, cannot adapt
} catch (RepositoryException e) {
- // either the user has no write permission or a more
- // sever exception occured - in both cases we don't return the map
+ // some other problem, cannot adapt
}
}