My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 17: AMAZON_AWS_S3_PKG - set_object_acl (enhancement suggestion)
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Feb 2013


Sign in to add a comment
 
Reported by jeffrey....@jk64.com, Sep 22, 2012
This procedure allows the caller to modify the permissions for an object in a bucket.

AMAZON_AWS_S3_PKG spec

  -- modify the access control list for an object
  procedure set_object_acl (p_bucket_name in varchar2,
                            p_key in varchar2,
                            p_acl in varchar2);

AMAZON_AWS_S3_PKG body

procedure set_object_acl (p_bucket_name in varchar2,
                          p_key in varchar2,
                          p_acl in varchar2) is

  l_key                          varchar2(4000) := utl_url.escape (p_key);

  l_clob                         clob;
  l_xml                          xmltype;

  l_date_str                     varchar2(255);
  l_auth_str                     varchar2(255);

  l_header_names                 t_str_array := t_str_array();
  l_header_values                t_str_array := t_str_array();

begin

  /*

  Purpose:   modify the access control list (owner and grantees) for an object

  Remarks:

  Who     Date        Description
  ------  ----------  -------------------------------------
  JKEMP   22.09.2012  Created

  */

  l_date_str := amazon_aws_auth_pkg.get_date_string;
  l_auth_str := amazon_aws_auth_pkg.get_auth_string ('PUT' || chr(10) || chr(10) || chr(10) || l_date_str || chr(10) || 'x-amz-acl:' || p_acl || chr(10) || '/' || p_bucket_name || '/' || l_key || '?acl');

  l_header_names.extend;
  l_header_names(1) := 'Host';
  l_header_values.extend;
  l_header_values(1) := get_host(p_bucket_name);

  l_header_names.extend;
  l_header_names(2) := 'Date';
  l_header_values.extend;
  l_header_values(2) := l_date_str;

  l_header_names.extend;
  l_header_names(3) := 'Authorization';
  l_header_values.extend;
  l_header_values(3) := l_auth_str;

  l_header_names.extend;
  l_header_names(4) := 'x-amz-acl';
  l_header_values.extend;
  l_header_values(4) := p_acl;

  l_clob := make_request (get_url(p_bucket_name, l_key) || '?acl', 'PUT', l_header_names, l_header_values);

  check_for_errors (l_clob);

end set_object_acl;
Sep 25, 2012
Project Member #1 thehunge...@gmail.com
(No comment was entered for this change.)
Status: Accepted
Labels: -Type-Defect Type-Enhancement
Feb 17, 2013
Project Member #2 thehunge...@gmail.com
Feature implemented in latest version of library.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting