pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    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="gigeowa" 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="6sigqkk" 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="ecacm2q" 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. 主站蜘蛛池模板: 苹果售后维修点查询,苹果iPhone授权售后维修服务中心 – 修果网 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | vr安全体验馆|交通安全|工地安全|禁毒|消防|安全教育体验馆|安全体验教室-贝森德(深圳)科技 | 楼承板设备-楼承板成型机-免浇筑楼承板机器厂家-捡来 | 丹佛斯变频器-Danfoss战略代理经销商-上海津信变频器有限公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 东莞市海宝机械有限公司-不锈钢分选机-硅胶橡胶-生活垃圾-涡电流-静电-金属-矿石分选机 | 万家财经_财经新闻_在线财经资讯网 | 上海防爆真空干燥箱-上海防爆冷库-上海防爆冷柜?-上海浦下防爆设备厂家? | 一体化污水处理设备,一体化污水设备厂家-宜兴市福源水处理设备有限公司 | 智能型高压核相仪-自动开口闪点测试仪-QJ41A电雷管测试仪|上海妙定 | 胀套-锁紧盘-风电锁紧盘-蛇形联轴器「厂家」-瑞安市宝德隆机械配件有限公司 | 闪电优家-卫生间防水补漏_酒店漏水渗水维修_防水堵漏公司 | 阿米巴企业经营-阿米巴咨询管理-阿米巴企业培训-广东键锋企业管理咨询有限公司 | 中视电广_短视频拍摄_短视频推广_短视频代运营_宣传片拍摄_影视广告制作_中视电广 | 岩棉切条机厂家_玻璃棉裁条机_水泥基保温板设备-廊坊鹏恒机械 | 宠物店加盟_宠物连锁店_开宠物店-【派多格宠物】 | 十字轴_十字轴万向节_十字轴总成-南京万传机械有限公司 | 温泉机设备|温泉小镇规划设计|碳酸泉设备 - 大连连邦温泉科技 | 电缆隧道在线监测-智慧配电站房-升压站在线监测-江苏久创电气科技有限公司 | 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 篮球架_乒乓球台_足球门_校园_竞技体育器材_厂家_价格-沧州浩然体育器材有限公司 | 电动高尔夫球车|电动观光车|电动巡逻车|电动越野车厂家-绿友机械集团股份有限公司 | 迪威娱乐|迪威娱乐客服|18183620002 | 邢台人才网_邢台招聘网_邢台123招聘【智达人才网】 | 老房子翻新装修,旧房墙面翻新,房屋防水补漏,厨房卫生间改造,室内装潢装修公司 - 一修房屋快修官网 | 北京翻译公司-专业合同翻译-医学标书翻译收费标准-慕迪灵 | 岩棉切条机厂家_玻璃棉裁条机_水泥基保温板设备-廊坊鹏恒机械 | 江苏南京多语种翻译-专业翻译公司报价-正规商务翻译机构-南京华彦翻译服务有限公司 | 干培两用箱-细菌恒温培养箱-菲斯福仪器| 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | 冷却塔改造厂家_不锈钢冷却塔_玻璃钢冷却塔改造维修-广东特菱节能空调设备有限公司 | 深圳工程师职称评定条件及流程_深圳职称评审_职称评审-职称网 | 低噪声电流前置放大器-SR570电流前置放大器-深圳市嘉士达精密仪器有限公司 | 北京易通慧公司从事北京网站优化,北京网络推广、网站建设一站式服务商-北京网站优化公司 | 高压绝缘垫-红色配电房绝缘垫-绿色高压绝缘地毯-上海苏海电气 | 万濠影像仪(万濠投影仪)百科-苏州林泽仪器 | 定制奶茶纸杯_定制豆浆杯_广东纸杯厂_[绿保佳]一家专业生产纸杯碗的厂家 | 沈阳真空机_沈阳真空包装机_沈阳大米真空包装机-沈阳海鹞真空包装机械有限公司 | 首页 - 张店继勇软件开发工作室 兰州UPS电源,兰州山特UPS-兰州万胜商贸 | 天津仓库出租网-天津电商仓库-天津云仓一件代发-【博程云仓】 | 电机保护器-电动机综合保护器-浙江开民 |