title: Create a Modal Dialog in Odoo Website
body: <p>I did create my Modal Popup in xml and put it in <code>/my_module/static/src/xml/</code> folder</p>
  
  <pre><code>&lt;t t-name="my_module.homepage_modal"&gt;
  &lt;!-- modal popup content , Signup prompt--&gt;
  &lt;/t&gt;
  </code></pre>
  
  <p>This template is associated with a Javascript widget.
  I did render it in homepage using JavaScript as follows.</p>
  
  <pre><code>ajax.loadXML('/my_module/static/src/xml/modal_view.xml', qweb);
  
  var ModalPopup = Widget.extend({
      template: 'my_module.homepage_modal',
  
      start: function () {
          this.$el.modal();
      },
  });
  
  base.ready().done(function() {
  
      if (location.pathname == '/'){
          var modal1 = new ModalPopup();
          modal1.appendTo($(document.body));
  
      };
  
  });`
  </code></pre>
  
  <p>I have to render this Popup only when the user is not logged in (ie Public user). How can I do this? <strong>How can I check the current user id from JavaScript?</strong></p>