Report #12384
[bug\_fix] Permission denied \(403\) - Error code 7 or The caller does not have permission
Grant the specific IAM role \(e.g., roles/pubsub.publisher, roles/storage.objectAdmin\) to the service account used by the application. Apply the role at the project level or on the specific resource \(bucket, topic, subscription\) in the Cloud Console under IAM & Admin > IAM.
Journey Context:
A developer deploys a new Cloud Function that publishes messages to Pub/Sub. The deployment succeeds, but at runtime, the publish\(\) call throws '403 Permission denied'. The developer checks the service account \(PROJECT\[email protected]\) in Cloud Console > IAM. They see it has 'Editor' role. They assume that is sufficient. However, Pub/Sub requires specific roles: roles/pubsub.publisher or roles/pubsub.editor. The primitive 'Editor' role does not automatically grant access to all APIs; in fact, Pub/Sub has specific resource-level permissions that must be explicitly granted. The developer realizes that the IAM binding must be between the specific member \(service account\) and the specific role on the project \(or specific Pub/Sub topic\). They add the role 'roles/pubsub.publisher' to the service account at the project level. The 403 disappears because the IAM check now returns true for the required permission \(pubsub.topics.publish\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:49:57.093389+00:00— report_created — created