deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-461 view-config meta-data added to AccessDecisionVoterContext
Date Thu, 05 Dec 2013 16:45:28 GMT
Updated Branches:
  refs/heads/master 662f458cd -> 5d60fd432


DELTASPIKE-461 view-config meta-data added to AccessDecisionVoterContext


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

Branch: refs/heads/master
Commit: 5d60fd432d27208e425a76154a02c94c139a95db
Parents: 662f458
Author: gpetracek <gpetracek@apache.org>
Authored: Thu Dec 5 17:43:09 2013 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Thu Dec 5 17:44:13 2013 +0100

----------------------------------------------------------------------
 .../apache/deltaspike/jsf/impl/util/SecurityUtils.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5d60fd43/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/SecurityUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/SecurityUtils.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/SecurityUtils.java
index bed7629..76df3e3 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/SecurityUtils.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/SecurityUtils.java
@@ -36,6 +36,7 @@ import org.apache.deltaspike.security.spi.authorization.SecurityViolationHandler
 import javax.enterprise.inject.Typed;
 import javax.faces.application.FacesMessage;
 import javax.faces.context.FacesContext;
+import java.lang.annotation.Annotation;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -59,6 +60,15 @@ public abstract class SecurityUtils
             return;
         }
 
+        accessDecisionVoterContext.addMetaData(ViewConfig.class.getName(), viewConfigDescriptor.getConfigClass());
+        for (Annotation viewMetaData : viewConfigDescriptor.getMetaData())
+        {
+            if (!viewMetaData.annotationType().equals(Secured.class))
+            {
+                accessDecisionVoterContext.addMetaData(viewMetaData.annotationType().getName(),
viewMetaData);
+            }
+        }
+
         Secured.Descriptor securedDescriptor = viewConfigDescriptor
                 .getExecutableCallbackDescriptor(Secured.class, Secured.Descriptor.class);
 


Mime
View raw message