ISecurityCheck check = getSecurityCheck(component);
if (check != null)
{
if (check.isActionAuthorized(getActionFactory().getAction(action)))
return true;
IAuthorizationMessageSource message = getMessageSource();
if (message != null)
{
message.setComponent(component);
message.addVariable("wicket.action", action);
message.addVariable("wasp.action", getActionFactory().getAction(action));
logMessage(message);
}
return false;
}
IModel<?> model = component.getDefaultModel();
if (model instanceof ISecureModel<?>)
{
if (((ISecureModel<?>)model).isAuthorized(component,
getActionFactory().getAction(action)))
return true;
IAuthorizationMessageSource message = getMessageSource();
if (message != null)
{
message.setComponent(component);
message.addVariable("wicket.action", action);
message.addVariable("wasp.action", getActionFactory().getAction(action));
logMessage(message);
}
return false;
}
}