java - 权限被拒绝执行功能
问题描述
我正在尝试运行下面给出的代码,其中“myApp”是我要运行的脚本中的函数名称。
ExecutionRequest request = new ExecutionRequest().setFunction("myApp").setDevMode(true);
try {
Operation op = service.scripts().run("some id", request).execute();
// Print results of request.
if (op.getError() != null) {
// The API executed, but the script returned an error.
System.out.println("Error");
} else {
System.out.println("Success");
}
} catch (GoogleJsonResponseException e) {
e.printStackTrace(System.out);
}
它给我的错误是:
{“代码”:404,“错误”:[{“域”:“全局”,“消息”:“未找到请求的实体。”,“原因”:“未找到”}],“消息”:“请求找不到实体。”,“状态”:“NOT_FOUND”}
或者,如果我将其部署为 Web 应用程序,则会出现此类错误:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "调用者没有权限", “原因”:“禁止”}],“消息”:“调用者没有权限”,“状态”:“PERMISSION_DENIED”}
我必须做什么完美地运行代码????
解决方案
推荐阅读
- mysql - 尽管它们相同,但 SQL 查询性能却有所不同
- c++ - c++ 解决方法:`从类型'B*' 的表达式中对类型'C*&' 的引用进行无效初始化
- javascript - jQuery 验证不验证我的 textarea 元素
- java - Return statement in test method
- apache-flink - How to join three or more datastreams /tables on a given key and a common window by datastrem API or Flink Table API/SQL?
- mongodb - Error $gte time error in mongodb
- azure-cosmosdb - cosmos db RequestRateTooLargeException
- ruby - Print/Export GUI interface at current state Ruby Shoes
- python-3.x - prepending relative links to absolute links in python
- php - cakeEmail getaddrinfo failed: No such host is known