久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <i id='SLktV'><tr id='SLktV'><dt id='SLktV'><q id='SLktV'><span id='SLktV'><b id='SLktV'><form id='SLktV'><ins id='SLktV'></ins><ul id='SLktV'></ul><sub id='SLktV'></sub></form><legend id='SLktV'></legend><bdo id='SLktV'><pre id='SLktV'><center id='SLktV'></center></pre></bdo></b><th id='SLktV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SLktV'><tfoot id='SLktV'></tfoot><dl id='SLktV'><fieldset id='SLktV'></fieldset></dl></div>

      <small id='SLktV'></small><noframes id='SLktV'>

        <tfoot id='SLktV'></tfoot>
      1. <legend id='SLktV'><style id='SLktV'><dir id='SLktV'><q id='SLktV'></q></dir></style></legend>
        • <bdo id='SLktV'></bdo><ul id='SLktV'></ul>

        Google Drive API - 從服務帳戶轉移所有權

        Google Drive API - Transfer ownership from Service Account(Google Drive API - 從服務帳戶轉移所有權)
        <legend id='E0Ldq'><style id='E0Ldq'><dir id='E0Ldq'><q id='E0Ldq'></q></dir></style></legend>
          • <tfoot id='E0Ldq'></tfoot>

            <small id='E0Ldq'></small><noframes id='E0Ldq'>

              <tbody id='E0Ldq'></tbody>
                <bdo id='E0Ldq'></bdo><ul id='E0Ldq'></ul>
                  <i id='E0Ldq'><tr id='E0Ldq'><dt id='E0Ldq'><q id='E0Ldq'><span id='E0Ldq'><b id='E0Ldq'><form id='E0Ldq'><ins id='E0Ldq'></ins><ul id='E0Ldq'></ul><sub id='E0Ldq'></sub></form><legend id='E0Ldq'></legend><bdo id='E0Ldq'><pre id='E0Ldq'><center id='E0Ldq'></center></pre></bdo></b><th id='E0Ldq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='E0Ldq'><tfoot id='E0Ldq'></tfoot><dl id='E0Ldq'><fieldset id='E0Ldq'></fieldset></dl></div>
                  本文介紹了Google Drive API - 從服務帳戶轉移所有權的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用以下代碼將所有權從服務帳戶創建的文檔轉移給位于同一 Google Apps 帳戶中的另一個用戶,但出現以下錯誤

                  I am attempting to transfer ownership from a Service Account created document to another user who resides within the same Google Apps account using the code below but am getting the following error

                  資源主體包含不可直接寫入的字段.[403]錯誤 [消息[資源正文包含不可直接寫入的字段.] Location[ - ] Reason[fieldNotWritable] Domain[global]]

                          var service = GetService();
                  
                          try
                          {
                              var permission = GetPermission(fileId, email);
                              permission.Role = "owner";
                  
                              var updatePermission = service.Permissions.Update(permission, fileId, permission.Id);
                              updatePermission.TransferOwnership = true;
                              return updatePermission.Execute();
                          }
                          catch (Exception e)
                          {
                              Console.WriteLine("An error occurred: " + e.Message);
                          }
                          return null;
                  

                  注釋掉//permission.Role = "owner";返回下面的錯誤

                  Commenting out // permission.Role = "owner"; returns the error below

                  當權限角色為所有者"時,必須啟用 transferOwnership 參數.[403] 錯誤 [消息[當權限角色為所有者"時,必須啟用 transferOwnership 參數.] Location[transferOwnership - parameter] Reason[forbidden] Domain[global]]

                  分配任何其他權限都可以正常工作.因此,這是服務帳戶無法將所有權轉移到不使用@gserviceaccount.com 電子郵件地址的任何其他帳戶的限制(即our-project@appspot.gserviceaccount.com > email@domain.com)?

                  Assigning any other permissions works fine. Therefore, is this a limitation of the Service Account not being able to transfer ownership to any other account that doesn't use the @gserviceaccount.com email address (i.e. our-project@appspot.gserviceaccount.com > email@domain.com)?

                  email@domain.com 電子郵件地址已創建并在 Google Apps 中進行管理.

                  The email@domain.com email address has been created and is managed within Google Apps.

                  在這種情況下,這是無法實現的,關于下一步該去哪里的任何指示?我們需要多個用戶能夠通過 API 即時創建文檔并分配權限和轉移所有權.

                  In the case, it is not achievable, any pointers on where to look next? We need multiple users to have the ability to create documents ad hoc and assign permissions and transfer ownership on the fly via the API.

                  謝謝

                  推薦答案

                  我找到了答案,并為遇到此問題的其他人發帖.

                  I have found the answer and am posting for anyone else who comes across this question.

                  1. 您不能使用 Google 推薦的服務帳戶密鑰 JSON 文件".
                  2. 您需要使用 p.12 證書文件進行身份驗證.
                  3. 創建模擬賬戶驅動服務的代碼如下.

                  1. You can not use the 'Service Account Key JSON file' as recommended by Google.
                  2. You need to use the p.12 certificate file for authentication.
                  3. The code to create a drive service for mimicking accounts is as follows.

                  public DriveService GetService(string certificatePath, string certificatePassword, string googleAppsEmailAccount, string emailAccountToMimic, bool allowWrite = true)
                  {
                      var certificate = new X509Certificate2(certificatePath, certificatePassword, X509KeyStorageFlags.Exportable);
                  
                      var credential = new ServiceAccountCredential(
                         new ServiceAccountCredential.Initializer(googleAppsEmailAccount)
                         {
                             Scopes = new[] { allowWrite ? DriveService.Scope.Drive : DriveService.Scope.DriveReadonly },
                             User = emailAccountToMimic
                         }.FromCertificate(certificate));
                  
                      // Create the service.
                      return new DriveService(new BaseClientService.Initializer
                      {
                          HttpClientInitializer = credential,
                          ApplicationName = ApplicationName
                      });
                  }
                  

                • 您需要按照此處列出的步驟在域范圍內委派服務帳戶的權限.

                • You need to follow the steps listed here to delegate domain-wide authority to the service account.

                  這篇關于Google Drive API - 從服務帳戶轉移所有權的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!
                • 相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)
                • <i id='W7Bmz'><tr id='W7Bmz'><dt id='W7Bmz'><q id='W7Bmz'><span id='W7Bmz'><b id='W7Bmz'><form id='W7Bmz'><ins id='W7Bmz'></ins><ul id='W7Bmz'></ul><sub id='W7Bmz'></sub></form><legend id='W7Bmz'></legend><bdo id='W7Bmz'><pre id='W7Bmz'><center id='W7Bmz'></center></pre></bdo></b><th id='W7Bmz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='W7Bmz'><tfoot id='W7Bmz'></tfoot><dl id='W7Bmz'><fieldset id='W7Bmz'></fieldset></dl></div>
                    <tbody id='W7Bmz'></tbody>
                    1. <tfoot id='W7Bmz'></tfoot>

                          <bdo id='W7Bmz'></bdo><ul id='W7Bmz'></ul>

                        • <legend id='W7Bmz'><style id='W7Bmz'><dir id='W7Bmz'><q id='W7Bmz'></q></dir></style></legend>

                          <small id='W7Bmz'></small><noframes id='W7Bmz'>

                          1. 主站蜘蛛池模板: 天天干天天爱天天操 | 精品一区二区三区在线观看国产 | 国产精品18毛片一区二区 | 国产偷自视频区视频 | 亚洲视频免费观看 | 欧美偷偷| 日韩一区二区三区视频 | 九九热最新视频 | 欧美电影在线观看网站 | 国产成人精品区一区二区不卡 | 成人性视频在线播放 | 亚洲欧美中文日韩在线 | 日本一区二区三区四区 | 亚洲人人 | 国产精品视频一区二区三区四蜜臂 | 国产精品区二区三区日本 | 99精品国产一区二区三区 | 精品久久久网站 | 91精品久久久久久久99 | 欧美a在线 | 精品国产一区二区在线 | 精品中文在线 | 在线看av网址 | www.国产精 | 亚洲精品日韩精品 | 成年免费大片黄在线观看一级 | 精品久久中文 | 欧美日韩三区 | 亚洲欧美一区二区三区在线 | 午夜天堂精品久久久久 | 狠狠干网站 | 成人免费视频网站在线看 | 国产高清在线视频 | 香蕉婷婷| 欧美久久久久久 | 亚洲一区二区三区高清 | 欧美日韩国产一区 | 中文字幕精 | 日本电影网站 | 日本精品一区 | 日本在线免费看最新的电影 |