Skip to main content
Google Cloud Arcade Calculator Logo
Google CloudArcade Calculator
Google Cloud Arcade Calculator Logo
Google CloudArcade Calculator

Google Cloud IAM for Beginners: Roles and Permissions

Understand Google Cloud IAM: principals, roles and permissions, why least privilege matters and how to fix a permission denied error.

Pawan Joshi (updated ) 3 min read
In this article

IAM stands for Identity and Access Management. It answers one question: who can do what on which resource?

Quick summary

  • A principal is who: a user, a group or a service account.
  • A role is a bundle of permissions.
  • A permission is one allowed action, such as reading a storage object.
  • You grant roles to principals on a resource.

The three parts

Principals can be a person's Google account, a Google group, or a service account, which is an identity for an application.

Roles come in three kinds:

KindExampleUse
BasicOwner, Editor, ViewerVery broad. Avoid in real projects
PredefinedStorage Object ViewerMade by Google for one service
CustomYour own listWhen no predefined role fits

Permissions look like storage.objects.get. You normally grant roles, not single permissions.

Least privilege

Give people and applications only the access they need. A reporting tool that only reads data should not have a role that can delete it. Basic roles are easy but give too much, so use predefined roles where you can.

Inheritance

Access flows down the hierarchy: organization, folders, projects, then resources. A role granted on a project applies to everything in it. Read Google Cloud projects explained for the structure.

Fixing "permission denied"

  1. Check who you are signed in as: gcloud auth list.
  2. Check the project: gcloud config list project.
  3. Look in IAM for your account and see which roles it has on that project.
  4. In a lab, make sure you used the lab's own username, not a personal account. See lab tips.

Granting a role from the command line

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="user:person@example.com" \
  --role="roles/storage.objectViewer"

Replace the values with your own, and only run it in a project you control.

Why it matters for Arcade

Many skill badges include an IAM or security lab. Understanding roles and service accounts helps you pass the challenge lab, where the instructions are shorter.

Frequently asked questions

What is the difference between Owner and Editor?

Owner has full control, including managing access and billing. Editor can change most resources but cannot manage who has access.

What is a service account?

An identity for an application or workload rather than a person. You give it roles like any other principal.

Why use least privilege?

If an account is misused or compromised, limited access limits the damage.