title: How do i create permission on google sheet on docs in PHP
body: <p>How do i create permission on google sheet on docs. Here it's show the error</p>
  
  <pre><code>{
   "error": {
   "errors": [
    {
       "domain": "global",
       "reason": "insufficientPermissions",
       "message": "Insufficient Permission"
    }
   ],
     "code": 403,
     "message": "Insufficient Permission"
    }
  }
  </code></pre>
  
  <p>here my code. i use php library.</p>
  
  <pre><code>function insertPermission($fileId) {
  
    $client = $this-&gt;getClient();
    $client-&gt;setScopes(Google_Service_Drive::DRIVE);
    $service = new Google_Service_Drive($client);
  
    $newPermission = new Google_Service_Drive_Permission(
          array(
              "role"=&gt; "writer",
              "type"=&gt; "domain",)  
      );
  
    try {
      return $service-&gt;permissions-&gt;create($fileId, $newPermission);
    } catch (Exception $e) {
      print "An error occurred: " . $e-&gt;getMessage();
    }
    return NULL;
  }
  </code></pre>
  
  <p>After set permisson it's denied and return this error. </p>