我正在设置一个主题并尝试授予 gmail 向该主题发送电子邮件通知的权限,但 API 调用抛出“用户无权执行此操作”。当我从https://cloud.google.com/pubsub/reference/rest/v1/projects.topics/setIamPolicy尝试时,我得到了同样的错误。顺便说一句,我最近开始看到这个问题。它以前工作正常。
POST https://pubsub.googleapis.com/v1/projects/macro-xxxxx-xxx/topics/exxxxx-inxxx:setIamPolicy?key={YOUR_API_KEY}
{
"policy": {
"bindings": [
{
"role": "roles/pubsub.publisher",
"members": [
"serviceAccount:gmail-api-push@system.gserviceaccount.com"
]
}
]
}
}
{
"error": {
"code": 403,
"message": "User not authorized to perform this action.",
"status": "PERMISSION_DENIED"
}
}
感谢任何帮助,谢谢。