久久久久久久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. 主站蜘蛛池模板: 久久av.com | 国内精品久久久久久久 | 亚洲国产精品一区 | 91免费电影 | 亚洲成人综合网站 | 国产色99精品9i | 午夜播放器在线观看 | 中文字幕在线看 | 国产精彩视频一区 | 日本精品视频一区二区三区四区 | 婷婷五月色综合香五月 | 欧美高清一级片 | 久久成人综合 | 最新午夜综合福利视频 | 国产精品视频网站 | 免费在线a视频 | 日韩中文字幕在线播放 | 欧美日韩成人 | 日韩在线一区二区三区 | 国产中文区二幕区2012 | 久久久精品综合 | 天天干b| 欧美亚洲高清 | 一区二区三区在线看 | 久久久久久久久一区 | 91久久国产综合久久 | 性做久久久久久免费观看欧美 | 日韩三级一区 | 成人一区二区三区在线观看 | av网站免费在线观看 | 午夜性视频 | 午夜在线电影网 | 婷婷综合在线 | 97精品国产一区二区三区 | 欧美日韩国产在线 | 成人午夜免费视频 | 久久中文视频 | 国产精品国产三级国产aⅴ中文 | 狠狠伊人| 91n成人| 免费三级网 |