async function grantAccessToTableOrView() {
    const dataset = client.dataset(datasetId);
    const table = dataset.table(tableId);

    // Get the IAM access policy for the table or view.
    const [policy] = await table.getIamPolicy();

    // Initialize bindings array.
    if (!policy.bindings) {
      policy.bindings = [];
    }

    // To grant access to a table or view
    // add bindings to the Table or View policy.
    //
    // Find more details about Policy and Binding objects here:
    // https://cloud.google.com/security-command-center/docs/reference/rest/Shared.Types/Policy
    // https://cloud.google.com/security-command-center/docs/reference/rest/Shared.Types/Binding
    const binding = {
      role,
      members: [principalId],
    };
    policy.bindings.push(binding);

    // Set the IAM access policy with updated bindings.
    await table.setIamPolicy(policy);

    // Show a success message.
    console.log(
      `Role '${role}' granted for principal '${principalId}' on resource '${datasetId}.${tableId}'.`
    );
  }
TODO(developer): Update and un-comment below lines