'Add or replace the JSON policy associated with the bucket.
:type policy: str
:param policy: The JSON policy as a string.'

def set_policy(self, policy, headers=None):

    response = self.connection.make_request('PUT', self.name, data=policy, query_args='policy', headers=headers)
    body = response.read()
    if ((response.status >= 200) and (response.status <= 204)):
        return True
    else:
        raise self.connection.provider.storage_response_error(response.status, response.reason, body)
