dependency updates
This commit is contained in:
@ -28,7 +28,7 @@ public abstract class AbstractAccessControlTag extends AbstractTag {
|
||||
|
||||
protected TagAttribute attribute;
|
||||
|
||||
public AbstractAccessControlTag(TagConfig config) {
|
||||
protected AbstractAccessControlTag(TagConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -19,42 +19,41 @@ import java.io.IOException;
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.view.facelets.FaceletContext;
|
||||
import javax.faces.view.facelets.TagConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Joern Muehlencord (joern@muehlencord.de)
|
||||
*/
|
||||
public abstract class AbstractAuthenticationTag extends AbstractTag {
|
||||
|
||||
protected AbstractAuthenticationTag(TagConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
protected abstract boolean isAuthenticated();
|
||||
|
||||
protected boolean applyTagHandler() {
|
||||
if (isAuthenticated()) {
|
||||
if (LOGGER.isTraceEnabled()) {
|
||||
LOGGER.trace("Authentication verified, tag will be evaluated");
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (LOGGER.isTraceEnabled()) {
|
||||
LOGGER.trace ("Authentifaction verification failed, tag will not be evaluated");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractAuthenticationTag.class);
|
||||
|
||||
@Override
|
||||
public void apply(FaceletContext fc, UIComponent uic) throws IOException {
|
||||
if (applyTagHandler()) {
|
||||
this.nextHandler.apply(fc, uic);
|
||||
}
|
||||
protected AbstractAuthenticationTag(TagConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
protected abstract boolean isAuthenticated();
|
||||
|
||||
protected boolean applyTagHandler() {
|
||||
if (isAuthenticated()) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Authentication verified, tag will be evaluated");
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Authentifaction verification failed, tag will not be evaluated");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(FaceletContext fc, UIComponent uic) throws IOException {
|
||||
if (applyTagHandler()) {
|
||||
this.nextHandler.apply(fc, uic);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,8 +19,6 @@ import javax.faces.view.facelets.TagConfig;
|
||||
import javax.faces.view.facelets.TagHandler;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -28,9 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||
*/
|
||||
public abstract class AbstractTag extends TagHandler {
|
||||
|
||||
protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractTag.class);
|
||||
|
||||
public AbstractTag(TagConfig config) {
|
||||
protected AbstractTag(TagConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user