]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_acl_swift.h
883b623af182a1bc2e7ff1daa668dbcd6a00208a
[ceph.git] / 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 "rgw_acl.h"
13
14 class RGWAccessControlPolicy_SWIFT : public RGWAccessControlPolicy
15 {
16 int add_grants(RGWRados *store,
17 const std::vector<std::string>& uids,
18 uint32_t perm);
19
20 public:
21 explicit RGWAccessControlPolicy_SWIFT(CephContext* const cct)
22 : RGWAccessControlPolicy(cct) {
23 }
24 ~RGWAccessControlPolicy_SWIFT() override = default;
25
26 int create(RGWRados *store,
27 const rgw_user& id,
28 const std::string& name,
29 const std::string& read_list,
30 const std::string& write_list,
31 uint32_t& rw_mask);
32 void filter_merge(uint32_t mask, RGWAccessControlPolicy_SWIFT *policy);
33 void to_str(std::string& read, std::string& write);
34 };
35
36 class RGWAccessControlPolicy_SWIFTAcct : public RGWAccessControlPolicy
37 {
38 public:
39 RGWAccessControlPolicy_SWIFTAcct(CephContext * const cct)
40 : RGWAccessControlPolicy(cct) {
41 }
42 ~RGWAccessControlPolicy_SWIFTAcct() override {}
43
44 void add_grants(RGWRados *store,
45 const std::vector<std::string>& uids,
46 uint32_t perm);
47 bool create(RGWRados *store,
48 const rgw_user& id,
49 const std::string& name,
50 const std::string& acl_str);
51 void to_str(std::string& acl) const;
52 };
53 #endif