title: You do not have permission to perform that action
body: <p>I have a time-triggered script that periodically retrieves content from an external source and updates a Google sites page with it. 
  According to <a href="https://developers.google.com/apps-script/guides/triggers/installable#restrictions" rel="nofollow noreferrer">this</a>, the script should be running under my account, which has full assess to that Google site page (tested by manually editing it).
  But when I run the script, I get the </p>
  
  <blockquote>
    <p>You do not have permission to perform that action. </p>
  </blockquote>
  
  <p>Why do I not have that permission when running the script, if I can edit the page manually?</p>
  
  <p>Here is the (generalized) script function:</p>
  
  <pre><code>function updatePage() {
    var site = 'https://sites.google.com/a/mydomain.com/myhome/mypagegroup/mypage';
    var pageName = '/mypagegroup/mypage';
  
    var site = SitesApp.getSiteByUrl(site);
    var page = site.getChildByName(pageName); //works fine
    Logger.log('page: ' + page.getTitle()); //displays correct page title
  
    var html = '&lt;p&gt;'; //in actual script, I get html from external source
  
    Logger.log('html: ' + html);
  
    page.setHtmlContent(html); //this is where the error is generated ("You do not have permission to perform that action")
  };
  </code></pre>