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 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
  access.add_reader_view other_dataset_view_object
end

See Also:

Instance Method Summary collapse

Instance Method Details

#add_owner_domain(domain) ⇒ Object

Add owner access to a domain.



183
184
185
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 183

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.



177
178
179
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 177

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. Accepted values are owners, writers, readers, and all.



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

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.



171
172
173
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 171

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.



122
123
124
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 122

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.



116
117
118
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 116

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. Accepted values are owners, writers, readers, and all.



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

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.



110
111
112
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 110

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. The view can be a Google::Cloud::Bigquery::View object, or a string identifier as specified by the Query Reference: +project_name:datasetId.tableId+.



140
141
142
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 140

def add_reader_view view
  add_access_view view
end

#add_writer_domain(domain) ⇒ Object

Add writer access to a domain.



158
159
160
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 158

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.



152
153
154
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 152

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. Accepted values are owners, writers, readers, and all.



165
166
167
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 165

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.



146
147
148
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 146

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

#owner_domain?(domain) ⇒ Boolean

Checks owner access for a domain.

Returns:

  • (Boolean)


355
356
357
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 355

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

#owner_group?(email) ⇒ Boolean

Checks owner access for a group.

Returns:

  • (Boolean)


349
350
351
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 349

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

#owner_special?(group) ⇒ Boolean

Checks owner access for a special group. Accepted values are owners, writers, readers, and all.

Returns:

  • (Boolean)


362
363
364
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 362

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

#owner_user?(email) ⇒ Boolean

Checks owner access for a user.

Returns:

  • (Boolean)


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

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

#reader_domain?(domain) ⇒ Boolean

Checks reader access for a domain.

Returns:

  • (Boolean)


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

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

#reader_group?(email) ⇒ Boolean

Checks reader access for a group.

Returns:

  • (Boolean)


288
289
290
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 288

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

#reader_special?(group) ⇒ Boolean

Checks reader access for a special group. Accepted values are owners, writers, readers, and all.

Returns:

  • (Boolean)


301
302
303
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 301

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

#reader_user?(email) ⇒ Boolean

Checks reader access for a user.

Returns:

  • (Boolean)


282
283
284
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 282

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

#reader_view?(view) ⇒ Boolean

Checks reader access for a view. The view can be a Google::Cloud::Bigquery::View object, or a string identifier as specified by the Query Reference: +project_name:datasetId.tableId+.

Returns:

  • (Boolean)


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

def reader_view? view
  lookup_access_view view
end

#remove_owner_domain(domain) ⇒ Object

Remove owner access from a domain.



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

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.



263
264
265
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 263

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. Accepted values are owners, writers, readers, and all.



276
277
278
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 276

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.



257
258
259
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 257

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.



208
209
210
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 208

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.



202
203
204
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 202

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. Accepted values are owners, writers, readers, and all.



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

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.



196
197
198
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 196

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. The view can be a Google::Cloud::Bigquery::View object, or a string identifier as specified by the Query Reference: +project_name:datasetId.tableId+.



226
227
228
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 226

def remove_reader_view view
  remove_access_view view
end

#remove_writer_domain(domain) ⇒ Object

Remove writer access from a domain.



244
245
246
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 244

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.



238
239
240
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 238

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. Accepted values are owners, writers, readers, and all.



251
252
253
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 251

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.



232
233
234
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 232

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

#writer_domain?(domain) ⇒ Boolean

Checks writer access for a domain.

Returns:

  • (Boolean)


330
331
332
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 330

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

#writer_group?(email) ⇒ Boolean

Checks writer access for a group.

Returns:

  • (Boolean)


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

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

#writer_special?(group) ⇒ Boolean

Checks writer access for a special group. Accepted values are owners, writers, readers, and all.

Returns:

  • (Boolean)


337
338
339
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 337

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

#writer_user?(email) ⇒ Boolean

Checks writer access for a user.

Returns:

  • (Boolean)


318
319
320
# File 'lib/google/cloud/bigquery/dataset/access.rb', line 318

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