title: TFS Extension - TF400813: The user ... is not authorized to access this resource
body: <p>I'm developing a TFS extension where I'm trying to access the dashboards Rest API.</p>
  
  <p>The extension has almost all the scopes assigned:</p>
  
  <pre><code>  "scopes": [
      "vso.build_execute",
      "vso.code_write",
      "vso.code_manage",
      "vso.dashboards_manage",
      "vso.dashboards",
      "vso.extension_manage",
      "vso.extension.data_write",
      "vso.gallery_manage",
      "vso.identity",
      "vso.notification_manage",
      "vso.packaging_manage",
      "vso.profile",
      "vso.project",
      "vso.project_manage",
      "vso.release_manage"
    ],
  </code></pre>
  
  <p>The below code is making the API call:</p>
  
  <pre><code>var webContext = VSS.getWebContext();
  console.log(`Collection URI: ${webContext.collection.uri}`);
  console.log(`Project Name: ${webContext.project.name}`);
  console.log(`User uniquename: ${webContext.user.uniqueName} id: ${webContext.user.id}`);
  var baseUri = webContext.collection.uri + "/" + webContext.project.name;
  var endpointUri = baseUri + "/_apis/dashboard/dashboards";
  console.log(endpointUri);
  var authToken = vssAuthentificationService.authTokenManager.getAuthorizationHeader(token);
  console.log(authToken);
  $.ajax({
      type: "GET",
      url: endpointUri,
      contentType: 'application/json',
      dataType: 'json',
      headers: { 'Authorization': authToken }
  })
      .done(function (data) {
          console.log(data);
      });
  </code></pre>
  
  <p>which returns:  </p>
  
  <pre><code>401 (Unauthorized); TF400813: The user ... is not authorized to access this resource  
  </code></pre>
  
  <p>If I change the API uri to:  </p>
  
  <pre><code>var endpointUri = baseUri + "/_apis/build/builds";  
  </code></pre>
  
  <p>the response is OK.  </p>
  
  <p>The user that's using the extension is a TFS collection administrator.</p>
  
  <p>What kind of permissions/scopes do I need to set in order to have access to the dashboards API?</p>
  
  <p>TFS Version 16.131.27701.1</p>