Sha256: 0fe1b3625fde1bab5d52cd9f7e6e8eb6f958a9e328be533de6d471eecfb7f5b5

Contents?: true

Size: 804 Bytes

Versions: 13

Compression:

Stored size: 804 Bytes

Contents

require 'fog/core/model'

module Fog
  module AWS
    class IAM

      class Policy < Fog::Model

        identity  :id, :aliases => 'PolicyName'
        attribute :username, :aliases => 'UserName'
        attribute :document, :aliases => 'PolicyDocument'
        
        def save
          requires :id
          requires :username
          requires :document

          data = connection.put_user_policy(username, id, document).body
          merge_attributes(data)
          true
        end
        
        def destroy
          requires :id
          requires :username

          connection.delete_user_policy(username, id)
          true
        end
        
        def user
          requires :username
          connection.users.get(username)
        end
        
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/aws/models/iam/policy.rb
fog-nirvanix-1.8.1 lib/fog/aws/models/iam/policy.rb
fog-parser-fix-1.6.1 lib/fog/aws/models/iam/policy.rb
fog-test-again-1.6.0 lib/fog/aws/models/iam/policy.rb
fog-parser-fix-1.6.0 lib/fog/aws/models/iam/policy.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/models/iam/policy.rb
fog-sgonyea-1.8.1 lib/fog/aws/models/iam/policy.rb
fog-1.8.0 lib/fog/aws/models/iam/policy.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/models/iam/policy.rb
fog-1.7.0 lib/fog/aws/models/iam/policy.rb
fog-1.6.0 lib/fog/aws/models/iam/policy.rb
fog-1.5.0 lib/fog/aws/models/iam/policy.rb
fog-1.4.0 lib/fog/aws/models/iam/policy.rb