original_string: protected function add_writer_to_file(\repository_googledocs\rest $client, $fileid, $email) {
          $updateeditor = [
              'emailAddress' => $email,
              'role' => 'writer',
              'type' => 'user'
          ];
          $params = ['fileid' => $fileid, 'sendNotificationEmail' => 'false'];
          $response = $client->call('create_permission', $params, json_encode($updateeditor));
          if (empty($response->id)) {
              $details = 'Cannot add user ' . $email . ' as a writer for document: ' . $fileid;
              throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
          }
          return true;
      }
code: protected function add_writer_to_file(\repository_googledocs\rest $client, $fileid, $email) {
          $updateeditor = [
              'emailAddress' => $email,
              'role' => 'writer',
              'type' => 'user'
          ];
          $params = ['fileid' => $fileid, 'sendNotificationEmail' => 'false'];
          $response = $client->call('create_permission', $params, json_encode($updateeditor));
          if (empty($response->id)) {
              $details = 'Cannot add user ' . $email . ' as a writer for document: ' . $fileid;
              throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
          }
          return true;
      }
code_tokens: protected function add_writer_to_file ( \ repository_googledocs \ rest $ client , $ fileid , $ email ) { $ updateeditor = [ 'emailAddress' => $ email , 'role' => 'writer' , 'type' => 'user' ] ; $ params = [ 'fileid' => $ fileid , 'sendNotificationEmail' => 'false' ] ; $ response = $ client -> call ( 'create_permission' , $ params , json_encode ( $ updateeditor ) ) ; if ( empty ( $ response -> id ) ) { $ details = 'Cannot add user ' . $ email . ' as a writer for document: ' . $ fileid ; throw new repository_exception ( 'errorwhilecommunicatingwith' , 'repository' , '' , $ details ) ; } return true ; }
docstring: Add a writer to the permissions on the file.
  
  @param \repository_googledocs\rest $client Authenticated client.
  @param string $fileid The file we are updating.
  @param string $email The email of the writer account to add.
  @return boolean
docstring_tokens: Add a writer to the permissions on the file .