//Checking if the user can add templates to a host
PermissionAPI perAPI = APILocator.getPermissionAPI();
List<Host> hosts = APILocator.getHostAPI().findAll( user, false );
hosts.remove( APILocator.getHostAPI().findSystemHost( user, false ) );
hosts = perAPI.filterCollection( hosts, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, false, user );
if ( hosts.size() == 0 ) {
req.setAttribute( WebKeys.TEMPLATE_CAN_ADD, false );
} else {
req.setAttribute( WebKeys.TEMPLATE_CAN_ADD, true );