Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

SEAMFACES-210 idea

View gist:1315602
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
diff --git a/impl/src/main/java/org/jboss/seam/faces/view/config/ViewConfigExtension.java b/impl/src/main/java/org/jboss/seam/faces/view/config/ViewConfigExtension.java
index 8d9cc59..610be78 100644
--- a/impl/src/main/java/org/jboss/seam/faces/view/config/ViewConfigExtension.java
+++ b/impl/src/main/java/org/jboss/seam/faces/view/config/ViewConfigExtension.java
@@ -59,6 +60,14 @@ public class ViewConfigExtension implements Extension {
log.warn("ViewConfig annotation should only be applied to interfaces, and [" + tp.getJavaClass()
+ "] is not an interface.");
} else {
+ // SEAMFACES-210
+ boolean securityNotFound = false;
+ try {
+ this.getClass().getClassLoader().loadClass("org.jboss.seam.security.annotations.SecurityBindingType");
+ } catch (ClassNotFoundException e) {
+ securityNotFound = true;
+ }
+
for (Class clazz : tp.getJavaClass().getClasses()) {
for (Field enumm : clazz.getFields())
if (enumm.isAnnotationPresent(ViewPattern.class)) {
@@ -69,6 +78,15 @@ public class ViewConfigExtension implements Extension {
if (a.annotationType() != ViewPattern.class) {
viewPattern.add(a);
}
+
+ // SEAMFACES-210
+ if (securityNotFound) {
+ for (Annotation annotation : a.getClass().getAnnotations()) {
+ if ("SecurityBindingType".equals(annotation.getClass().getSimpleName())) {
+ throw new RuntimeException("Security annotation found without Seam Security present");
+ }
+ }
+ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.