You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2014/08/05 23:25:13 UTC

git commit: DELTASPIKE-681 aligned handling with @Secured

Repository: deltaspike
Updated Branches:
  refs/heads/master cf109c757 -> 3a270ec59


DELTASPIKE-681 aligned handling with @Secured


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/3a270ec5
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/3a270ec5
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/3a270ec5

Branch: refs/heads/master
Commit: 3a270ec59e1dc58f5e98fc0b40e997102ae57325
Parents: cf109c7
Author: gpetracek <gp...@apache.org>
Authored: Tue Aug 5 23:20:14 2014 +0200
Committer: gpetracek <gp...@apache.org>
Committed: Tue Aug 5 23:22:18 2014 +0200

----------------------------------------------------------------------
 .../impl/extension/DefaultSecurityStrategy.java        | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/3a270ec5/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/DefaultSecurityStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/DefaultSecurityStrategy.java b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/DefaultSecurityStrategy.java
index 0ef1316..f43fda6 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/DefaultSecurityStrategy.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/DefaultSecurityStrategy.java
@@ -121,6 +121,7 @@ public class DefaultSecurityStrategy implements SecurityStrategy
     /**
      * <p>Fires a {@link org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent} for the given
      * {@link org.apache.deltaspike.security.api.authorization.AccessDeniedException}.</p>
+     * It also allows to change the default handling.
      *
      * @param originalException exception thrown by an authorizer
      * @return the original exception if the default behavior was changed and the exception is unhandled
@@ -129,16 +130,6 @@ public class DefaultSecurityStrategy implements SecurityStrategy
     {
         ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(originalException);
         this.beanManager.fireEvent(exceptionToCatchEvent);
-        //the next step won't happen per default since ExceptionHandlerBroadcaster will throw the exception,
-        //because BeforeAccessDeniedExceptionHandler calls #throwOriginal
-        //but allows to suppress it via deactivating BeforeAccessDeniedExceptionHandler
-        //(or a 2nd @BeforeHandles method which overrules the default behavior
-        //(if needed)
-        if (!exceptionToCatchEvent.isHandled())
-        {
-            throw originalException;
-        }
-
-        return null;
+        return originalException;
     }
 }
\ No newline at end of file