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"

gcloud = Google::Cloud.new
bigquery = gcloud.bigquery
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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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+.



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

def add_reader_view view
  add_access_view view
end

#add_writer_domain(domain) ⇒ Object

Add writer access to a domain.



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

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.



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

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.



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

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.



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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

def reader_view? view
  lookup_access_view view
end

#remove_owner_domain(domain) ⇒ Object

Remove owner access from a domain.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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+.



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

def remove_reader_view view
  remove_access_view view
end

#remove_writer_domain(domain) ⇒ Object

Remove writer access from a domain.



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

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.



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

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.



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

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.



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

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)


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

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)


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

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)


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

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)


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

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