Author: mreutegg
Date: Thu Mar 17 10:16:49 2005
New Revision: 157956
URL: http://svn.apache.org/viewcvs?view=rev&rev=157956
Log:
Session.checkPermission() logs a warn message with full stacktrace if an action is denied.
Permission checks are daily business and should not log such stacktraces.
Modified:
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java?view=diff&r1=157955&r2=157956
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java Thu Mar
17 10:16:49 2005
@@ -561,6 +561,10 @@
String msg = "invalid path: " + absPath;
log.warn(msg, mpe);
throw new AccessControlException(ADD_NODE_ACTION);
+ } catch (AccessDeniedException re) {
+ // otherwise the RepositoryException catch clause will
+ // log a warn message, which is not appropriate in this case.
+ throw new AccessControlException(ADD_NODE_ACTION);
} catch (RepositoryException re) {
String msg = "failed to check WRITE permission on parent of " + absPath;
log.warn(msg, re);
@@ -588,6 +592,10 @@
String msg = "invalid path: " + absPath;
log.warn(msg, mpe);
throw new AccessControlException(REMOVE_ACTION);
+ } catch (AccessDeniedException re) {
+ // otherwise the RepositoryException catch clause will
+ // log a warn message, which is not appropriate in this case.
+ throw new AccessControlException(REMOVE_ACTION);
} catch (RepositoryException re) {
String msg = "failed to check REMOVE permission on " + absPath;
log.warn(msg, re);
@@ -630,6 +638,10 @@
} catch (MalformedPathException mpe) {
String msg = "invalid path: " + absPath;
log.warn(msg, mpe);
+ throw new AccessControlException(SET_PROPERTY_ACTION);
+ } catch (AccessDeniedException re) {
+ // otherwise the RepositoryException catch clause will
+ // log a warn message, which is not appropriate in this case.
throw new AccessControlException(SET_PROPERTY_ACTION);
} catch (RepositoryException re) {
String msg = "failed to check WRITE permission on parent of " + absPath;
|