Create IAM policy
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Create an IAM policy for a table.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["This page provides code samples in Java and Python for creating an IAM policy for a BigQuery table."],["The Java code sample initializes a BigQuery client, retrieves the existing IAM policy for a specified table, and adds a user with the \"roles/bigquery.dataViewer\" role."],["The Python code sample demonstrates retrieving the IAM policy for a table, defining a binding with a specified role and member, appending the binding to the policy, and then setting and printing the updated policy."],["Both Java and Python samples require setting up Application Default Credentials for authentication, as detailed in the linked documentation."],["The code provided will allow users to control access to resources within BigQuery, as further explained in a linked article."]]],[]]