return new ArrayList<Role>(); } else { Role[] allowedRoles = secured.value(); return Arrays.asList(allowedRoles);
@Override public Secured beforeAddToConfig(Secured metaData, ViewConfigNode viewConfigNode) { viewConfigNode.registerCallbackDescriptors(Secured.class, new Descriptor(metaData.value())); return metaData; //no change needed } }
@Override public Secured beforeAddToConfig(Secured metaData, ViewConfigNode viewConfigNode) { viewConfigNode.registerCallbackDescriptors(Secured.class, new Descriptor(metaData.value())); return metaData; //no change needed } }
@Override public Secured beforeAddToConfig(Secured metaData, ViewConfigNode viewConfigNode) { viewConfigNode.registerCallbackDescriptors(Secured.class, new Descriptor(metaData.value())); return metaData; //no change needed } }
@Secures @Secured({ }) @SuppressWarnings("UnusedDeclaration") public boolean doSecuredCheck(InvocationContext invocationContext) throws Exception { List<Class<? extends AccessDecisionVoter>> voterClasses = new ArrayList<Class<? extends AccessDecisionVoter>>(); List<Annotation> annotatedTypeMetadata = extractMetadata(invocationContext); for (Annotation annotation : annotatedTypeMetadata) { if (Secured.class.isAssignableFrom(annotation.annotationType())) { voterClasses.addAll(Arrays.asList(((Secured) annotation).value())); } else if (voterContext instanceof EditableAccessDecisionVoterContext) { ((EditableAccessDecisionVoterContext) voterContext) .addMetaData(annotation.annotationType().getName(), annotation); } } invokeVoters(invocationContext, voterClasses); //needed by @SecurityBindingType //X TODO check the use-cases for it return true; }
@Secures @Secured({ }) @SuppressWarnings("UnusedDeclaration") public boolean doSecuredCheck(InvocationContext invocationContext) throws Exception { Secured secured = null; List<Annotation> annotatedTypeMetadata = extractMetadata(invocationContext); for (Annotation annotation : annotatedTypeMetadata) { if (Secured.class.isAssignableFrom(annotation.annotationType())) { secured = (Secured) annotation; } else if (voterContext instanceof EditableAccessDecisionVoterContext) { ((EditableAccessDecisionVoterContext) voterContext) .addMetaData(annotation.annotationType().getName(), annotation); } } if (secured != null) { Class<? extends AccessDecisionVoter>[] voterClasses = secured.value(); invokeVoters(invocationContext, Arrays.asList(voterClasses)); } //needed by @SecurityBindingType //X TODO check the use-cases for it return true; }