很抱歉,从存储中读取时发生服务器错误.错误代码PERMISSION_DENIED [英] We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED

本文介绍了很抱歉,从存储中读取时发生服务器错误.错误代码PERMISSION_DENIED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个google脚本编辑器插件,并将其发布到具有私有可见性的google市场(仅对我组织中的用户可见).我在脚本编辑器中使用所有类型的权限(为当前用户安装,在当前文档中启用,已安装和启用)对插件进行了测试,一切正常.但是,在将插件发布到市场并将其安装在测试电子表格中之后,我不断收到此错误:onOpen函数中的We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED..

I wrote a google scripts editor addon, and published it to the google marketplace with private visibility (it is only visible to the users in my organization). I tested the addon with all types of permissions (installed for current user, enabled in current document, installed and enabled) in the script editor, and everything works as intended. However, after publishing the addon to the marketplace and installing it in a test spreadsheet, I keep getting this error: We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED. from the onOpen function.

我正在明确设置这些oauth范围:

I am setting these oauth scopes explicitly:

"oauthScopes": [
    "https://www.googleapis.com/auth/script.container.ui",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/script.scriptapp",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/userinfo.profile"
  ]

这是我的onOpen触发器:

function onOpen(e: AppsScriptEvent) {
    if (e && e.authMode !== ScriptApp.AuthMode.NONE) {
        const ui = SpreadsheetApp.getUi();
        const menu = ui.createAddonMenu();
        menu.addItem("Add New Offering", "addNewOffering");
        menu.addSeparator();
        menu.addSubMenu(
            ui
                .createMenu("Settings")
                .addItem("Dashboard Name", "changeDashboardName")
                .addItem("Dashboard Start Cell", "changeDashboardStartCell")
        );
        menu.addToUi();
    }
}

我在这里还缺少其他类型的权限吗?

What other type of permission am I missing here?

推荐答案

使用多个帐户登录时,禁用App Script V8运行时为我解决了此问题...

Disabling App Script V8 runtime fixed the issue for me when logged with multiple accounts...

我正在使用非主要Google帐户开发一个加载项,因此从HTML对话框调用服务器端Google App脚本函数时遇到错误.

I was developing an Add-on on my non-primary Google account so I was facing the error when calling server-side Google App Script functions from HTML Dialogs.

我希望能帮上忙.

这篇关于很抱歉,从存储中读取时发生服务器错误.错误代码PERMISSION_DENIED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆