Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / rgw / rgw_acl_swift.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
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
12 #include <boost/optional.hpp>
13
14 #include "rgw_acl.h"
15
16 class RGWAccessControlPolicy_SWIFT : public RGWAccessControlPolicy
17 {
18   int add_grants(RGWRados *store,
19                  const std::vector<std::string>& uids,
20                  uint32_t perm);
21
22 public:
23   explicit RGWAccessControlPolicy_SWIFT(CephContext* const cct)
24     : RGWAccessControlPolicy(cct) {
25   }
26   ~RGWAccessControlPolicy_SWIFT() override = default;
27
28   int create(RGWRados *store,
29              const rgw_user& id,
30              const std::string& name,
31              const std::string& read_list,
32              const std::string& write_list,
33              uint32_t& rw_mask);
34   void filter_merge(uint32_t mask, RGWAccessControlPolicy_SWIFT *policy);
35   void to_str(std::string& read, std::string& write);
36 };
37
38 class RGWAccessControlPolicy_SWIFTAcct : public RGWAccessControlPolicy
39 {
40 public:
41   RGWAccessControlPolicy_SWIFTAcct(CephContext * const cct)
42     : RGWAccessControlPolicy(cct) {
43   }
44   ~RGWAccessControlPolicy_SWIFTAcct() override {}
45
46   void add_grants(RGWRados *store,
47                   const std::vector<std::string>& uids,
48                   uint32_t perm);
49   bool create(RGWRados *store,
50               const rgw_user& id,
51               const std::string& name,
52               const std::string& acl_str);
53   boost::optional<std::string> to_str() const;
54 };
55 #endif