]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
9f95a23c | 2 | // vim: ts=8 sw=2 smarttab ft=cpp |
7c673cae FG |
3 | |
4 | #ifndef CEPH_RGW_ACL_SWIFT_H | |
5 | #define CEPH_RGW_ACL_SWIFT_H | |
6 | ||
7 | #include <map> | |
8 | #include <vector> | |
9 | #include <string> | |
10 | #include <include/types.h> | |
11 | ||
224ce89b WB |
12 | #include <boost/optional.hpp> |
13 | ||
7c673cae FG |
14 | #include "rgw_acl.h" |
15 | ||
9f95a23c TL |
16 | class RGWUserCtl; |
17 | ||
7c673cae FG |
18 | class RGWAccessControlPolicy_SWIFT : public RGWAccessControlPolicy |
19 | { | |
b3b6e05e | 20 | int add_grants(const DoutPrefixProvider *dpp, RGWUserCtl *user_ctl, |
7c673cae FG |
21 | const std::vector<std::string>& uids, |
22 | uint32_t perm); | |
23 | ||
24 | public: | |
25 | explicit RGWAccessControlPolicy_SWIFT(CephContext* const cct) | |
26 | : RGWAccessControlPolicy(cct) { | |
27 | } | |
28 | ~RGWAccessControlPolicy_SWIFT() override = default; | |
29 | ||
b3b6e05e TL |
30 | int create(const DoutPrefixProvider *dpp, |
31 | RGWUserCtl *user_ctl, | |
7c673cae FG |
32 | const rgw_user& id, |
33 | const std::string& name, | |
28e407b8 AA |
34 | const char* read_list, |
35 | const char* write_list, | |
7c673cae FG |
36 | uint32_t& rw_mask); |
37 | void filter_merge(uint32_t mask, RGWAccessControlPolicy_SWIFT *policy); | |
38 | void to_str(std::string& read, std::string& write); | |
39 | }; | |
40 | ||
41 | class RGWAccessControlPolicy_SWIFTAcct : public RGWAccessControlPolicy | |
42 | { | |
43 | public: | |
11fdf7f2 | 44 | explicit RGWAccessControlPolicy_SWIFTAcct(CephContext * const cct) |
7c673cae FG |
45 | : RGWAccessControlPolicy(cct) { |
46 | } | |
47 | ~RGWAccessControlPolicy_SWIFTAcct() override {} | |
48 | ||
b3b6e05e TL |
49 | void add_grants(const DoutPrefixProvider *dpp, |
50 | RGWUserCtl *user_ctl, | |
7c673cae FG |
51 | const std::vector<std::string>& uids, |
52 | uint32_t perm); | |
b3b6e05e TL |
53 | bool create(const DoutPrefixProvider *dpp, |
54 | RGWUserCtl *user_ctl, | |
7c673cae FG |
55 | const rgw_user& id, |
56 | const std::string& name, | |
57 | const std::string& acl_str); | |
224ce89b | 58 | boost::optional<std::string> to_str() const; |
7c673cae FG |
59 | }; |
60 | #endif |