Class: Google::Cloud::Bigquery::Dataset::Access

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/bigquery/dataset/access.rb

Overview

Dataset Access Control

Represents the access control rules for a Google::Cloud::Bigquery::Dataset.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_group "owners@example.com"
  access.add_writer_user "writer@example.com"
  access.remove_writer_user "readers@example.com"
  access.add_reader_special :all_users
end

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rulesObject (readonly)

Returns the value of attribute rules.



67
68
69
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 67

def rules
  @rules
end

Instance Method Details

#add_owner_domain(domain) ⇒ Object

Add owner access to a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_domain "example.com"
end

Parameters:



482
483
484
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 482

def add_owner_domain domain
  add_access_role_scope_value :owner, :domain, domain
end

#add_owner_group(email) ⇒ Object

Add owner access to a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



442
443
444
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 442

def add_owner_group email
  add_access_role_scope_value :owner, :group, email
end

#add_owner_iam_member(identity) ⇒ Object

Add owner access to some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



462
463
464
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 462

def add_owner_iam_member identity
  add_access_role_scope_value :owner, :iam_member, identity
end

#add_owner_special(group) ⇒ Object

Add owner access to a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



502
503
504
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 502

def add_owner_special group
  add_access_role_scope_value :owner, :special, group
end

#add_owner_user(email) ⇒ Object

Add owner access to a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_owner_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



423
424
425
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 423

def add_owner_user email
  add_access_role_scope_value :owner, :user, email
end

#add_reader_dataset(dataset) ⇒ Object

Add reader access to a dataset.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

params = {
  dataset_id: other_dataset.dataset_id,
  project_id: other_dataset.project_id,
  target_types: ["VIEWS"]
}

dataset.access do |access|
  access.add_reader_dataset params
end
require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

dataset.access do |access|
  access.add_reader_dataset other_dataset.access_entry(target_types: ["VIEWS"])
end

Parameters:

  • dataset (Google::Cloud::Bigquery::DatasetAccessEntry, Hash<String,String>)

    A DatasetAccessEntry or a Hash object. Required



306
307
308
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 306

def add_reader_dataset dataset
  add_access_dataset dataset
end

#add_reader_domain(domain) ⇒ Object

Add reader access to a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_reader_domain "example.com"
end

Parameters:



194
195
196
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 194

def add_reader_domain domain
  add_access_role_scope_value :reader, :domain, domain
end

#add_reader_group(email) ⇒ Object

Add reader access to a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_reader_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



154
155
156
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 154

def add_reader_group email
  add_access_role_scope_value :reader, :group, email
end

#add_reader_iam_member(identity) ⇒ Object

Add reader access to some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_reader_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



174
175
176
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 174

def add_reader_iam_member identity
  add_access_role_scope_value :reader, :iam_member, identity
end

#add_reader_routine(routine) ⇒ Object

Add access to a routine from a different dataset. Queries executed against that routine will have read access to views/tables/routines in this dataset. Only UDF is supported for now. The role field is not required when this field is set. If that routine is updated by any user, access to the routine needs to be granted again via an update operation.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

routine = other_dataset.routine "my_routine"

dataset.access do |access|
  access.add_reader_routine routine
end

Parameters:



241
242
243
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 241

def add_reader_routine routine
  add_access_routine routine
end

#add_reader_special(group) ⇒ Object

Add reader access to a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_reader_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



214
215
216
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 214

def add_reader_special group
  add_access_role_scope_value :reader, :special, group
end

#add_reader_user(email) ⇒ Object

Add reader access to a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_reader_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



135
136
137
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 135

def add_reader_user email
  add_access_role_scope_value :reader, :user, email
end

#add_reader_view(view) ⇒ Object

Add reader access to a view.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

view = other_dataset.table "my_view", skip_lookup: true

dataset.access do |access|
  access.add_reader_view view
end

Parameters:



268
269
270
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 268

def add_reader_view view
  add_access_view view
end

#add_writer_domain(domain) ⇒ Object

Add writer access to a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_writer_domain "example.com"
end

Parameters:



384
385
386
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 384

def add_writer_domain domain
  add_access_role_scope_value :writer, :domain, domain
end

#add_writer_group(email) ⇒ Object

Add writer access to a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_writer_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



344
345
346
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 344

def add_writer_group email
  add_access_role_scope_value :writer, :group, email
end

#add_writer_iam_member(identity) ⇒ Object

Add writer access to some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_writer_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



364
365
366
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 364

def add_writer_iam_member identity
  add_access_role_scope_value :writer, :iam_member, identity
end

#add_writer_special(group) ⇒ Object

Add writer access to a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_writer_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



404
405
406
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 404

def add_writer_special group
  add_access_role_scope_value :writer, :special, group
end

#add_writer_user(email) ⇒ Object

Add writer access to a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.add_writer_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



325
326
327
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 325

def add_writer_user email
  add_access_role_scope_value :writer, :user, email
end

#owner_domain?(domain) ⇒ Boolean

Checks owner access for a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.owner_domain? "example.com" #=> false

Parameters:

Returns:

  • (Boolean)


1229
1230
1231
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1229

def owner_domain? domain
  lookup_access_role_scope_value :owner, :domain, domain
end

#owner_group?(email) ⇒ Boolean

Checks owner access for a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.owner_group? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


1191
1192
1193
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1191

def owner_group? email
  lookup_access_role_scope_value :owner, :group, email
end

#owner_iam_member?(identity) ⇒ Boolean

Checks owner access for some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.owner_iam_member? "entity@example.com" #=> false

Parameters:

  • identity (String)

    The identity reference.

Returns:

  • (Boolean)


1210
1211
1212
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1210

def owner_iam_member? identity
  lookup_access_role_scope_value :owner, :iam_member, identity
end

#owner_special?(group) ⇒ Boolean

Checks owner access for a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.owner_special? :all_users #=> false

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.

Returns:

  • (Boolean)


1248
1249
1250
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1248

def owner_special? group
  lookup_access_role_scope_value :owner, :special, group
end

#owner_user?(email) ⇒ Boolean

Checks owner access for a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.owner_user? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


1173
1174
1175
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1173

def owner_user? email
  lookup_access_role_scope_value :owner, :user, email
end

#reader_dataset?(dataset) ⇒ Boolean

Checks reader access for a dataset.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

params = {
  dataset_id: other_dataset.dataset_id,
  project_id: other_dataset.project_id,
  target_types: ["VIEWS"]
}

dataset.access.reader_dataset? params
require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

dataset.access.reader_dataset? other_dataset.access_entry(target_types: ["VIEWS"])

Parameters:

  • dataset (Google::Cloud::Bigquery::DatasetAccessEntry, Hash<String,String>)

    A DatasetAccessEntry or a Hash object. Required

Returns:

  • (Boolean)


1062
1063
1064
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1062

def reader_dataset? dataset
  lookup_access_dataset dataset
end

#reader_domain?(domain) ⇒ Boolean

Checks reader access for a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.reader_domain? "example.com" #=> false

Parameters:

Returns:

  • (Boolean)


957
958
959
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 957

def reader_domain? domain
  lookup_access_role_scope_value :reader, :domain, domain
end

#reader_group?(email) ⇒ Boolean

Checks reader access for a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.reader_group? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


919
920
921
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 919

def reader_group? email
  lookup_access_role_scope_value :reader, :group, email
end

#reader_iam_member?(identity) ⇒ Boolean

Checks reader access for some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.reader_iam_member? "entity@example.com" #=> false

Parameters:

  • identity (String)

    The identity reference.

Returns:

  • (Boolean)


938
939
940
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 938

def reader_iam_member? identity
  lookup_access_role_scope_value :reader, :iam_member, identity
end

#reader_routine?(routine) ⇒ Boolean

Checks access for a routine from a different dataset. Queries executed against that routine will have read access to views/tables/routines in this dataset. Only UDF is supported for now. The role field is not required when this field is set. If that routine is updated by any user, access to the routine needs to be granted again via an update operation.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

routine = other_dataset.routine "my_routine", skip_lookup: true

access = dataset.access
access.reader_routine? routine #=> false

Parameters:

Returns:

  • (Boolean)


1002
1003
1004
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1002

def reader_routine? routine
  lookup_access_routine routine
end

#reader_special?(group) ⇒ Boolean

Checks reader access for a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.reader_special? :all_users #=> false

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.

Returns:

  • (Boolean)


976
977
978
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 976

def reader_special? group
  lookup_access_role_scope_value :reader, :special, group
end

#reader_user?(email) ⇒ Boolean

Checks reader access for a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.reader_user? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


901
902
903
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 901

def reader_user? email
  lookup_access_role_scope_value :reader, :user, email
end

#reader_view?(view) ⇒ Boolean

Checks reader access for a view.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

view = other_dataset.table "my_view", skip_lookup: true

access = dataset.access
access.reader_view? view #=> false

Parameters:

Returns:

  • (Boolean)


1028
1029
1030
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1028

def reader_view? view
  lookup_access_view view
end

#remove_owner_domain(domain) ⇒ Object

Remove owner access from a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_owner_domain "example.com"
end

Parameters:



863
864
865
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 863

def remove_owner_domain domain
  remove_access_role_scope_value :owner, :domain, domain
end

#remove_owner_group(email) ⇒ Object

Remove owner access from a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_owner_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



823
824
825
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 823

def remove_owner_group email
  remove_access_role_scope_value :owner, :group, email
end

#remove_owner_iam_member(identity) ⇒ Object

Remove owner access from some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_owner_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



843
844
845
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 843

def remove_owner_iam_member identity
  remove_access_role_scope_value :owner, :iam_member, identity
end

#remove_owner_special(group) ⇒ Object

Remove owner access from a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_owner_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



883
884
885
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 883

def remove_owner_special group
  remove_access_role_scope_value :owner, :special, group
end

#remove_owner_user(email) ⇒ Object

Remove owner access from a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_owner_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



804
805
806
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 804

def remove_owner_user email
  remove_access_role_scope_value :owner, :user, email
end

#remove_reader_dataset(dataset) ⇒ Object

Removes reader access of a dataset.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

params = {
  dataset_id: other_dataset.dataset_id,
  project_id: other_dataset.project_id,
  target_types: ["VIEWS"]
}

dataset.access do |access|
  access.remove_reader_dataset params
end
require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

dataset.access do |access|
  access.remove_reader_dataset other_dataset.access_entry(target_types: ["VIEWS"])
end

Parameters:

  • dataset (Google::Cloud::Bigquery::DatasetAccessEntry, Hash<String,String>)

    A DatasetAccessEntry or a Hash object. Required



687
688
689
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 687

def remove_reader_dataset dataset
  remove_access_dataset dataset
end

#remove_reader_domain(domain) ⇒ Object

Remove reader access from a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_reader_domain "example.com"
end

Parameters:



580
581
582
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 580

def remove_reader_domain domain
  remove_access_role_scope_value :reader, :domain, domain
end

#remove_reader_group(email) ⇒ Object

Remove reader access from a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_reader_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



540
541
542
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 540

def remove_reader_group email
  remove_access_role_scope_value :reader, :group, email
end

#remove_reader_iam_member(identity) ⇒ Object

Remove reader access from some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_reader_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



560
561
562
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 560

def remove_reader_iam_member identity
  remove_access_role_scope_value :reader, :iam_member, identity
end

#remove_reader_routine(routine) ⇒ Object

Remove reader access from a routine from a different dataset.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

routine = other_dataset.routine "my_routine", skip_lookup: true

dataset.access do |access|
  access.remove_reader_routine routine
end

Parameters:



622
623
624
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 622

def remove_reader_routine routine
  remove_access_routine routine
end

#remove_reader_special(group) ⇒ Object

Remove reader access from a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_reader_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



600
601
602
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 600

def remove_reader_special group
  remove_access_role_scope_value :reader, :special, group
end

#remove_reader_user(email) ⇒ Object

Remove reader access from a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_reader_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



521
522
523
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 521

def remove_reader_user email
  remove_access_role_scope_value :reader, :user, email
end

#remove_reader_view(view) ⇒ Object

Remove reader access from a view.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"
other_dataset = bigquery.dataset "my_other_dataset", skip_lookup: true

view = other_dataset.table "my_view", skip_lookup: true

dataset.access do |access|
  access.remove_reader_view view
end

Parameters:



649
650
651
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 649

def remove_reader_view view
  remove_access_view view
end

#remove_writer_domain(domain) ⇒ Object

Remove writer access from a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_writer_domain "example.com"
end

Parameters:



765
766
767
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 765

def remove_writer_domain domain
  remove_access_role_scope_value :writer, :domain, domain
end

#remove_writer_group(email) ⇒ Object

Remove writer access from a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_writer_group "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



725
726
727
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 725

def remove_writer_group email
  remove_access_role_scope_value :writer, :group, email
end

#remove_writer_iam_member(identity) ⇒ Object

Remove writer access from some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_writer_iam_member "entity@example.com"
end

Parameters:

  • identity (String)

    The identity reference.



745
746
747
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 745

def remove_writer_iam_member identity
  remove_access_role_scope_value :writer, :iam_member, identity
end

#remove_writer_special(group) ⇒ Object

Remove writer access from a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_writer_special :all_users
end

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.



785
786
787
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 785

def remove_writer_special group
  remove_access_role_scope_value :writer, :special, group
end

#remove_writer_user(email) ⇒ Object

Remove writer access from a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

dataset.access do |access|
  access.remove_writer_user "entity@example.com"
end

Parameters:

  • email (String)

    The email address for the entity.



706
707
708
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 706

def remove_writer_user email
  remove_access_role_scope_value :writer, :user, email
end

#writer_domain?(domain) ⇒ Boolean

Checks writer access for a domain.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.writer_domain? "example.com" #=> false

Parameters:

Returns:

  • (Boolean)


1136
1137
1138
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1136

def writer_domain? domain
  lookup_access_role_scope_value :writer, :domain, domain
end

#writer_group?(email) ⇒ Boolean

Checks writer access for a group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.writer_group? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


1098
1099
1100
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1098

def writer_group? email
  lookup_access_role_scope_value :writer, :group, email
end

#writer_iam_member?(identity) ⇒ Boolean

Checks writer access for some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.writer_iam_member? "entity@example.com" #=> false

Parameters:

  • identity (String)

    The identity reference.

Returns:

  • (Boolean)


1117
1118
1119
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1117

def writer_iam_member? identity
  lookup_access_role_scope_value :writer, :iam_member, identity
end

#writer_special?(group) ⇒ Boolean

Checks writer access for a special group.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.writer_special? :all_users #=> false

Parameters:

  • group (String)

    Accepted values are owners, writers, readers, all_authenticated_users, and all_users.

Returns:

  • (Boolean)


1155
1156
1157
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1155

def writer_special? group
  lookup_access_role_scope_value :writer, :special, group
end

#writer_user?(email) ⇒ Boolean

Checks writer access for a user.

Examples:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
dataset = bigquery.dataset "my_dataset"

access = dataset.access
access.writer_user? "entity@example.com" #=> false

Parameters:

  • email (String)

    The email address for the entity.

Returns:

  • (Boolean)


1080
1081
1082
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 1080

def writer_user? email
  lookup_access_role_scope_value :writer, :user, email
end