Class: Fog::AWS::IAM::ManagedPolicy

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/iam/managed_policy.rb

Instance Method Summary collapse

Instance Method Details

#attach(user_or_username) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fog/aws/models/iam/managed_policy.rb', line 17

def attach(user_or_username)
  requires :arn

  username = if user_or_username.respond_to?(:identity)
               user_or_username.identity
             else
               user_or_username
             end

  service.attach_user_policy(username, self.arn)
end

#documentObject



29
30
31
32
33
34
# File 'lib/fog/aws/models/iam/managed_policy.rb', line 29

def document
  requires :arn, :default_version

  service.get_policy_version(self.arn, self.default_version).
    body['PolicyVersion']['Document']
end