/** * {@inheritDoc} */ public Object execute(InvocationContext invocationContext) throws Exception { AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); 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, this.beanManager, voterContext, Arrays.asList(voterClasses), secured.errorView()); } return invocationContext.proceed(); }
/** * {@inheritDoc} */ public Object execute(InvocationContext invocationContext) throws Exception { AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); 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, this.beanManager, voterContext, Arrays.asList(voterClasses), secured.errorView()); } return invocationContext.proceed(); }
/** * {@inheritDoc} */ public Object execute(InvocationContext invocationContext) throws Exception { AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); 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, this.beanManager, voterContext, Arrays.asList(voterClasses), secured.errorView()); } return invocationContext.proceed(); }
private void checkPermission(BeanManager beanManager, FacesContext facesContext) { ViewConfigDescriptor entry = ViewConfigCache.getViewConfigDescriptor(facesContext.getViewRoot().getViewId()); if(entry == null) { return; } try { Class<? extends ViewConfig> errorView = null; AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); if(entry instanceof EditableViewConfigDescriptor) { errorView = ((EditableViewConfigDescriptor)entry).getErrorView(); } invokeVoters(null, beanManager, voterContext, entry.getAccessDecisionVoters(), errorView); } catch (AccessDeniedException accessDeniedException) { tryToHandleSecurityViolation(accessDeniedException); facesContext.renderResponse(); } }
private void checkPermission(BeanManager beanManager, FacesContext facesContext) { ViewConfigDescriptor entry = ViewConfigCache.getViewConfigDescriptor(facesContext.getViewRoot().getViewId()); if(entry == null) { return; } try { Class<? extends ViewConfig> errorView = null; AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); if(entry instanceof EditableViewConfigDescriptor) { errorView = ((EditableViewConfigDescriptor)entry).getErrorView(); } invokeVoters(null, beanManager, voterContext, entry.getAccessDecisionVoters(), errorView); } catch (AccessDeniedException accessDeniedException) { tryToHandleSecurityViolation(accessDeniedException); facesContext.renderResponse(); } }
private void checkPermission(BeanManager beanManager, FacesContext facesContext) { ViewConfigDescriptor entry = ViewConfigCache.getViewConfigDescriptor(facesContext.getViewRoot().getViewId()); if(entry == null) { return; } try { Class<? extends ViewConfig> errorView = null; AccessDecisionVoterContext voterContext = CodiUtils.getContextualReferenceByClass(beanManager, AccessDecisionVoterContext.class, true); if(entry instanceof EditableViewConfigDescriptor) { errorView = ((EditableViewConfigDescriptor)entry).getErrorView(); } invokeVoters(null, beanManager, voterContext, entry.getAccessDecisionVoters(), errorView); } catch (AccessDeniedException accessDeniedException) { tryToHandleSecurityViolation(accessDeniedException); facesContext.renderResponse(); } }
invokeVoters(null /*TODO*/, this.beanManager, voterContext, entry.getAccessDecisionVoters(), errorView);
invokeVoters(null /*TODO*/, this.beanManager, voterContext, entry.getAccessDecisionVoters(), errorView);
invokeVoters(null /*TODO*/, this.beanManager, voterContext, entry.getAccessDecisionVoters(), errorView);