1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
9 #include <include/types.h>
11 #include "include/str_list.h"
14 #include "rgw_sal_fwd.h"
18 class ACLPermission_S3
: public ACLPermission
, public XMLObj
22 virtual ~ACLPermission_S3() override
{}
24 bool xml_end(const char *el
) override
;
25 void to_xml(std::ostream
& out
);
28 class ACLGrantee_S3
: public ACLGrantee
, public XMLObj
32 virtual ~ACLGrantee_S3() override
{}
34 bool xml_start(const char *el
, const char **attr
);
38 class ACLGrant_S3
: public ACLGrant
, public XMLObj
42 virtual ~ACLGrant_S3() override
{}
44 void to_xml(CephContext
*cct
, std::ostream
& out
);
45 bool xml_end(const char *el
) override
;
46 bool xml_start(const char *el
, const char **attr
);
48 static ACLGroupTypeEnum
uri_to_group(std::string
& uri
);
49 static bool group_to_uri(ACLGroupTypeEnum group
, std::string
& uri
);
52 class RGWAccessControlList_S3
: public RGWAccessControlList
, public XMLObj
55 explicit RGWAccessControlList_S3(CephContext
*_cct
) : RGWAccessControlList(_cct
) {}
56 virtual ~RGWAccessControlList_S3() override
{}
58 bool xml_end(const char *el
) override
;
59 void to_xml(std::ostream
& out
);
61 int create_canned(ACLOwner
& owner
, ACLOwner
& bucket_owner
, const std::string
& canned_acl
);
62 int create_from_grants(std::list
<ACLGrant
>& grants
);
65 class ACLOwner_S3
: public ACLOwner
, public XMLObj
69 virtual ~ACLOwner_S3() override
{}
71 bool xml_end(const char *el
) override
;
72 void to_xml(std::ostream
& out
);
77 class RGWAccessControlPolicy_S3
: public RGWAccessControlPolicy
, public XMLObj
80 explicit RGWAccessControlPolicy_S3(CephContext
*_cct
) : RGWAccessControlPolicy(_cct
) {}
81 virtual ~RGWAccessControlPolicy_S3() override
{}
83 bool xml_end(const char *el
) override
;
85 void to_xml(std::ostream
& out
);
86 int rebuild(const DoutPrefixProvider
*dpp
, rgw::sal::Driver
* driver
, ACLOwner
*owner
,
87 RGWAccessControlPolicy
& dest
, std::string
&err_msg
);
88 bool compare_group_name(std::string
& id
, ACLGroupTypeEnum group
) override
;
90 virtual int create_canned(ACLOwner
& _owner
, ACLOwner
& bucket_owner
, const std::string
& canned_acl
) {
91 RGWAccessControlList_S3
& _acl
= static_cast<RGWAccessControlList_S3
&>(acl
);
92 if (_owner
.get_id() == rgw_user("anonymous")) {
97 int ret
= _acl
.create_canned(owner
, bucket_owner
, canned_acl
);
100 int create_from_headers(const DoutPrefixProvider
*dpp
, rgw::sal::Driver
* driver
,
101 const RGWEnv
*env
, ACLOwner
& _owner
);
105 * Interfaces with the webserver's XML handling code
106 * to parse it in a way that makes sense for the rgw.
108 class RGWACLXMLParser_S3
: public RGWXMLParser
112 XMLObj
*alloc_obj(const char *el
) override
;
114 explicit RGWACLXMLParser_S3(CephContext
*_cct
) : cct(_cct
) {}