Sha256: fb36253b7e9ec6f8f14e9f08d5ef1f04fb80ac01d0a65bdfe85605a37543aa6c

Contents?: true

Size: 1.24 KB

Versions: 24

Compression:

Stored size: 1.24 KB

Contents

module Fog
  module AWS
    class IAM
      class Real

        require 'fog/aws/parsers/iam/basic'

        # Add or update a policy for a user
        # 
        # ==== Parameters
        # * user_name<~String>: name of the user
        # * policy_name<~String>: name of policy document
        # * policy_document<~Hash>: policy document, see: http://docs.amazonwebservices.com/IAM/latest/UserGuide/PoliciesOverview.html
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'RequestId'<~String> - Id of the request
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_PutUserPolicy.html
        #
        def put_user_policy(user_name, policy_name, policy_document)
          request(
            'Action'          => 'PutUserPolicy',
            'PolicyName'      => policy_name,
            'PolicyDocument'  => policy_document.to_json,
            'UserName'        => user_name,
            :parser           => Fog::Parsers::AWS::IAM::Basic.new
          )
        end

      end

      class Mock

        def put_user_policy(user_name, policy_name, policy_document)
          Fog::Mock.not_implemented
        end

      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
fog-0.5.1 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.5.0 lib/fog/aws/requests/iam/put_user_policy.rb
phpfog-fog-0.4.1.3 lib/fog/aws/requests/iam/put_user_policy.rb
phpfog-fog-0.4.1.2 lib/fog/aws/requests/iam/put_user_policy.rb
phpfog-fog-0.4.1.1 lib/fog/aws/requests/iam/put_user_policy.rb
phpfog-fog-0.4.1 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.4.1 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.4.0 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.34 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.33 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.32 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.31 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.30 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.29 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.28 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.27 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.26 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.25 lib/fog/aws/requests/iam/put_user_policy.rb
fog-0.3.24 lib/fog/aws/requests/iam/put_user_policy.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/aws/requests/iam/put_user_policy.rb