Return-Path: X-Original-To: apmail-deltaspike-commits-archive@www.apache.org Delivered-To: apmail-deltaspike-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEE00115FF for ; Tue, 5 Aug 2014 21:25:13 +0000 (UTC) Received: (qmail 38475 invoked by uid 500); 5 Aug 2014 21:25:13 -0000 Delivered-To: apmail-deltaspike-commits-archive@deltaspike.apache.org Received: (qmail 38384 invoked by uid 500); 5 Aug 2014 21:25:13 -0000 Mailing-List: contact commits-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltaspike.apache.org Delivered-To: mailing list commits@deltaspike.apache.org Received: (qmail 38266 invoked by uid 99); 5 Aug 2014 21:25:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2014 21:25:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 237169C06BF; Tue, 5 Aug 2014 21:25:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gpetracek@apache.org To: commits@deltaspike.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: DELTASPIKE-681 aligned handling with @Secured Date: Tue, 5 Aug 2014 21:25:13 +0000 (UTC) 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 Authored: Tue Aug 5 23:20:14 2014 +0200 Committer: gpetracek 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 /** *

Fires a {@link org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent} for the given * {@link org.apache.deltaspike.security.api.authorization.AccessDeniedException}.

+ * 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