/*
* Initialize required objects
*/
SidRetrievalStrategy sidRetrievalStrategy = getBeanOfType(applicationContext, SidRetrievalStrategy.class);
if (sidRetrievalStrategy == null) {
sidRetrievalStrategy = new SidRetrievalStrategyImpl();
}
ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy = getBeanOfType(applicationContext, ObjectIdentityRetrievalStrategy.class);
if (objectIdentityRetrievalStrategy == null) {
objectIdentityRetrievalStrategy = new ObjectIdentityRetrievalStrategyImpl();
}
/*
* Compute permissions
*/
if ((null == permissions) || permissions.isEmpty()) {
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Permissions are null or empty. Access is DENIED. ",
new Object[] {TemplateEngine.threadIndex()});
}
return false;
}
if (domainObject == null) {
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Domain object for resolved to null. Access by " +
"Access Control List is GRANTED.", new Object[] {TemplateEngine.threadIndex()});
}
// Access to null object is considered always true
return true;
}
final List<Sid> sids =
sidRetrievalStrategy.getSids(SecurityContextHolder.getContext().getAuthentication());
final ObjectIdentity oid =
objectIdentityRetrievalStrategy.getObjectIdentity(domainObject);
try {