Class: SDM::Policy
- Inherits:
-
Object
- Object
- SDM::Policy
- Defined in:
- lib/models/porcelain.rb
Overview
Policy is a collection of one or more statements that enforce fine-grained access control for the users of an organization.
Instance Attribute Summary collapse
-
#description ⇒ Object
Optional description of the Policy.
-
#id ⇒ Object
Unique identifier of the Policy.
-
#name ⇒ Object
Unique human-readable name of the Policy.
-
#policy ⇒ Object
The content of the Policy, in Cedar policy language.
Instance Method Summary collapse
-
#initialize(description: nil, id: nil, name: nil, policy: nil) ⇒ Policy
constructor
A new instance of Policy.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(description: nil, id: nil, name: nil, policy: nil) ⇒ Policy
Returns a new instance of Policy.
8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 |
# File 'lib/models/porcelain.rb', line 8219 def initialize( description: nil, id: nil, name: nil, policy: nil ) @description = description == nil ? "" : description @id = id == nil ? "" : id @name = name == nil ? "" : name @policy = policy == nil ? "" : policy end |
Instance Attribute Details
#description ⇒ Object
Optional description of the Policy.
8211 8212 8213 |
# File 'lib/models/porcelain.rb', line 8211 def description @description end |
#id ⇒ Object
Unique identifier of the Policy.
8213 8214 8215 |
# File 'lib/models/porcelain.rb', line 8213 def id @id end |
#name ⇒ Object
Unique human-readable name of the Policy.
8215 8216 8217 |
# File 'lib/models/porcelain.rb', line 8215 def name @name end |
#policy ⇒ Object
The content of the Policy, in Cedar policy language.
8217 8218 8219 |
# File 'lib/models/porcelain.rb', line 8217 def policy @policy end |
Instance Method Details
#to_json(options = {}) ⇒ Object
8231 8232 8233 8234 8235 8236 8237 |
# File 'lib/models/porcelain.rb', line 8231 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |