class Google::Cloud::Storage::Policy::Condition
end
})
}
expression: expr
description: “description of condition”,
title: “my-condition”,
condition: {
members: [“user:owner@example.com”],
role: “roles/storage.admin”,
p.bindings.insert({
expr = “resource.name.startsWith("projects/_/buckets/bucket-name/objects/prefix-a-")”
p.version = 3 # Must be explicitly set to opt-in to support for conditions.
p.version # the value is 1
bucket.policy requested_policy_version: 3 do |p|
bucket.uniform_bucket_level_access = true
bucket = storage.bucket “my-bucket”
storage = Google::Cloud::Storage.new
require “google/cloud/storage”
@example Updating a Policy from version 1 to version 3 by adding a condition:
end
puts binding.condition.title if binding.condition
policy.bindings.each do |binding|
policy = bucket.policy requested_policy_version: 3
bucket = storage.bucket “my-bucket”
storage = Google::Cloud::Storage.new
require “google/cloud/storage”
@example
following CEL language specification. Required.
one attributes, and statements are combined using logic operators,
The condition expression can contain multiple statements, each uses
expression using a subset of the Common Expression Language (CEL).
@attr [String] expression Defines an attribute-based logic
@attr [String] description Used to document the condition. Optional.
@attr [String] title Used to identify the condition. Required.
policies with conditions
@see cloud.google.com/iam/docs/conditions-overview Cloud IAM
subset of the Common Expression Language (CEL).
Value object accepting an attribute-based logic expression based on a
# Condition
#
def description= new_description
-
new_description
(String
) -- The new description.
def description= new_description @description = String new_description end
def expression= new_expression
-
new_expression
(String
) -- The new expression.
Other tags:
- See: https://cloud.google.com/iam/docs/conditions-overview - CEL for conditions
def expression= new_expression @expression = String new_expression end
def initialize title:, expression:, description: nil
-
expression
(String
) -- Defines an attribute-based logic -
description
(String
) -- Used to document the condition. Optional. -
title
(String
) -- Used to identify the condition. Required.
def initialize title:, expression:, description: nil @title = String title @description = String description @expression = String expression end
def title= new_title
-
new_title
(String
) -- The new title.
def title= new_title @title = String new_title end
def to_gapi
def to_gapi { title: @title, description: @description, expression: @expression }.delete_if { |_, v| v.nil? } end