Class: Cerbos::Output::CheckResources::Result::Metadata
- Inherits:
-
Object
- Object
- Cerbos::Output::CheckResources::Result::Metadata
- Defined in:
- lib/cerbos/output/check_resources.rb
Overview
Additional information about how policy decisions were reached.
Defined Under Namespace
Classes: Effect
Instance Attribute Summary collapse
-
#actions ⇒ Hash{String => Effect}
readonly
Additional information about how the policy decision was reached for each action.
-
#effective_derived_roles ⇒ Array<String>
readonly
The derived roles that were applied to the principal for the resource.
Instance Attribute Details
#actions ⇒ Hash{String => Effect} (readonly)
Additional information about how the policy decision was reached for each action.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/cerbos/output/check_resources.rb', line 190 CheckResources::Result::Metadata = Output.new_class(:actions, :effective_derived_roles) do # @!attribute [r] actions # Additional information about how the policy decision was reached for each action. # # @return [Hash{String => Effect}] # @!attribute [r] effective_derived_roles # The derived roles that were applied to the principal for the resource. # # @return [Array<String>] # # @see https://docs.cerbos.dev/cerbos/latest/policies/derived_roles.html Derived roles def self.from_protobuf() return nil if .nil? new( actions: .actions.map { |action, effect| [action, CheckResources::Result::Metadata::Effect.from_protobuf(effect)] }.to_h, effective_derived_roles: .effective_derived_roles || [] ) end end |
#effective_derived_roles ⇒ Array<String> (readonly)
The derived roles that were applied to the principal for the resource.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/cerbos/output/check_resources.rb', line 190 CheckResources::Result::Metadata = Output.new_class(:actions, :effective_derived_roles) do # @!attribute [r] actions # Additional information about how the policy decision was reached for each action. # # @return [Hash{String => Effect}] # @!attribute [r] effective_derived_roles # The derived roles that were applied to the principal for the resource. # # @return [Array<String>] # # @see https://docs.cerbos.dev/cerbos/latest/policies/derived_roles.html Derived roles def self.from_protobuf() return nil if .nil? new( actions: .actions.map { |action, effect| [action, CheckResources::Result::Metadata::Effect.from_protobuf(effect)] }.to_h, effective_derived_roles: .effective_derived_roles || [] ) end end |