{
if ( resource != null && StringUtils.isNotEmpty( resource.trim() ) )
{
if ( !getSecuritySystem().isAuthorized( getSecuritySession(), role, resource ) )
{
throw new AuthorizationRequiredException( ERROR_MSG_AUTHORIZATION_REQUIRED );
}
}
else
{
if ( requiredResource || !getSecuritySystem().isAuthorized( getSecuritySession(), role ) )
{
throw new AuthorizationRequiredException( ERROR_MSG_AUTHORIZATION_REQUIRED );
}
}
}
catch ( AuthorizationException ae )
{
throw new AuthorizationRequiredException( ERROR_MSG_PROCESSING_AUTHORIZATION );
}
}