module AwsExtensions::S3::BucketPolicy

Public Instance Methods

policy_string() click to toggle source

Public: Method that will either return the bucket policy, or an empty string if there is no policy. We have to do this because catching an exception is the ONLY way to determine if there is a policy.

Returns the policy as a string.

# File lib/aws_extensions/s3/BucketPolicy.rb, line 11
def policy_string
  policy.string
rescue Aws::S3::Errors::NoSuchBucketPolicy
  ""
end