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 Method Summary collapse

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:



352
353
354
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 352

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.



332
333
334
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 332

def add_owner_group email
  add_access_role_scope_value :owner, :group, email
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.



372
373
374
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 372

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.



313
314
315
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 313

def add_owner_user email
  add_access_role_scope_value :owner, :user, email
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:



169
170
171
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 169

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.



149
150
151
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 149

def add_reader_group email
  add_access_role_scope_value :reader, :group, email
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.



189
190
191
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 189

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.



130
131
132
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 130

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"

view = other_dataset.table "my_view"

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

Parameters:



216
217
218
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 216

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:



274
275
276
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 274

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.



254
255
256
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 254

def add_writer_group email
  add_access_role_scope_value :writer, :group, email
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.



294
295
296
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 294

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.



235
236
237
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 235

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)


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

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)


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

def owner_group? email
  lookup_access_role_scope_value :owner, :group, email
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)


881
882
883
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 881

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)


825
826
827
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 825

def owner_user? email
  lookup_access_role_scope_value :owner, :user, email
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)


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

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)


669
670
671
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 669

def reader_group? email
  lookup_access_role_scope_value :reader, :group, email
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)


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

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)


651
652
653
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 651

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"

view = other_dataset.table "my_view"

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

Parameters:

Returns:

  • (Boolean)


733
734
735
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 733

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:



613
614
615
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 613

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.



593
594
595
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 593

def remove_owner_group email
  remove_access_role_scope_value :owner, :group, email
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.



633
634
635
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 633

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.



574
575
576
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 574

def remove_owner_user email
  remove_access_role_scope_value :owner, :user, email
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:



430
431
432
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 430

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.



410
411
412
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 410

def remove_reader_group email
  remove_access_role_scope_value :reader, :group, email
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.



450
451
452
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 450

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.



391
392
393
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 391

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"

view = other_dataset.table "my_view"

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

Parameters:



477
478
479
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 477

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:



535
536
537
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 535

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.



515
516
517
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 515

def remove_writer_group email
  remove_access_role_scope_value :writer, :group, email
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.



555
556
557
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 555

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.



496
497
498
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 496

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)


788
789
790
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 788

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)


769
770
771
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 769

def writer_group? email
  lookup_access_role_scope_value :writer, :group, email
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)


807
808
809
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 807

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)


751
752
753
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 751

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