Permissions
Permissions are the atomic unit of access control in IAM. A permission authorizes a specific action on a resource type. Examples:bigquery.tables.get— read metadata for a BigQuery tablebigquery.tables.update— modify a tablestorage.objects.create— upload an object to a Cloud Storage bucketcompute.instances.start— start a Compute Engine VM
service.resource.action (or service.action). Note that you cannot grant individual permissions directly to a member; you grant roles that bundle permissions.
Roles
A role is a collection of permissions. When you bind a role to a member on a resource, that member receives every permission included in the role.
Best practices:
- Prefer predefined roles over primitive roles.
- Use custom roles only when predefined roles do not meet your needs.
- Apply the principle of least privilege: grant the minimum set of permissions required, and scope them as narrowly as possible.
IAM Policy Structure
Permissions are granted through IAM policies attached to resources. A policy is a collection of bindings. Each binding associates a role to one or more members and can include an optional condition. Example policy (JSON):role: the role being granted (e.g.,roles/storage.objectViewer).members: identities receiving the role, e.g.,user:,group:,serviceAccount:,domain:.condition(optional): an expression to restrict when or how the role applies (by time, resource, or request attributes).
Common gcloud Commands
Use gcloud to inspect and modify policies, describe roles, and create custom roles.
Use the Policy Troubleshooter and IAM Policy Simulator in the Cloud Console to validate whether a member has a specific permission on a resource.
Always follow the principle of least privilege: grant only the roles and permissions required. Prefer predefined roles for common tasks, and create custom roles only when necessary.
How Permissions Map to Resources
Roles can be granted at different resource levels. Permissions granted at a higher level are inherited by resources under that scope.
Examples:
- Granting
roles/bigquery.dataViewerat the project level allows viewing datasets and tables across that project. - Granting
roles/storage.objectAdminon a specific bucket allows full object management only for that bucket.
Example: BigQuery and Cloud Storage Patterns
- Analyst who needs read-only access across datasets: grant
roles/bigquery.dataViewerat the project or dataset level. - ETL service account that loads data into BigQuery and writes to Cloud Storage: grant a combination such as
roles/bigquery.dataEditor(or a narrower custom role) plusroles/storage.objectCreatoron the target bucket(s). - When cross-project access is required, consider granting roles at the project level of the target project (not the source) or using IAM service account impersonation with limited roles.
Troubleshooting and Validation
- Use the Policy Troubleshooter to answer “Does member X have permission Y on resource Z?” in the console.
- Use the IAM Policy Analyzer / Simulator to test changes before applying custom roles or complex conditional bindings.
- When debugging access errors, check:
- The effective permissions (including inherited roles).
- Whether a deny policy exists that overrides allow bindings.
- Any IAM conditions that might restrict access by time or attributes.
Summary
- Permissions (e.g.,
bigquery.tables.get) are the atomic units of authorization. - Roles are collections of permissions that are granted to members.
- Use predefined roles where possible; create custom roles only when needed.
- Scope roles at the narrowest resource level that still supports your workflow, and leverage IAM conditions for finer control.
- Use gcloud and Console tools (Policy Troubleshooter, IAM Simulator) to inspect, validate, and test policies.
Links and References
- IAM Overview — Google Cloud
- IAM Roles — Google Cloud
- BigQuery Access Control
- Cloud Storage IAM
- gcloud reference — projects