]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab ft=cpp | |
3 | ||
4 | /* | |
5 | * Ceph - scalable distributed file system | |
6 | * | |
7 | * Copyright (C) 2019 SUSE LLC | |
8 | * | |
9 | * This is free software; you can redistribute it and/or | |
10 | * modify it under the terms of the GNU Lesser General Public | |
11 | * License version 2.1, as published by the Free Software | |
12 | * Foundation. See file COPYING. | |
13 | * | |
14 | */ | |
15 | ||
16 | #pragma once | |
17 | #include <include/types.h> | |
18 | ||
19 | class XMLObj; | |
20 | ||
21 | class PublicAccessBlockConfiguration { | |
22 | bool BlockPublicAcls; | |
23 | bool IgnorePublicAcls; | |
24 | bool BlockPublicPolicy; | |
25 | bool RestrictPublicBuckets; | |
26 | public: | |
27 | PublicAccessBlockConfiguration(): | |
28 | BlockPublicAcls(false), IgnorePublicAcls(false), | |
29 | BlockPublicPolicy(false), RestrictPublicBuckets(false) | |
30 | {} | |
31 | ||
32 | auto block_public_acls() const { | |
33 | return BlockPublicAcls; | |
34 | } | |
35 | auto ignore_public_acls() const { | |
36 | return IgnorePublicAcls; | |
37 | } | |
38 | auto block_public_policy() const { | |
39 | return BlockPublicPolicy; | |
40 | } | |
41 | auto restrict_public_buckets() const { | |
42 | return RestrictPublicBuckets; | |
43 | } | |
44 | ||
45 | void encode(ceph::bufferlist& bl) const { | |
46 | ENCODE_START(1,1, bl); | |
47 | encode(BlockPublicAcls, bl); | |
48 | encode(IgnorePublicAcls, bl); | |
49 | encode(BlockPublicPolicy, bl); | |
50 | encode(RestrictPublicBuckets, bl); | |
51 | ENCODE_FINISH(bl); | |
52 | } | |
53 | ||
54 | void decode(ceph::bufferlist::const_iterator& bl) { | |
55 | DECODE_START(1,bl); | |
56 | decode(BlockPublicAcls, bl); | |
57 | decode(IgnorePublicAcls, bl); | |
58 | decode(BlockPublicPolicy, bl); | |
59 | decode(RestrictPublicBuckets, bl); | |
60 | DECODE_FINISH(bl); | |
61 | } | |
62 | ||
63 | void decode_xml(XMLObj *obj); | |
64 | void dump_xml(Formatter *f) const; | |
65 | }; | |
66 | WRITE_CLASS_ENCODER(PublicAccessBlockConfiguration) | |
20effc67 | 67 | std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf); |