Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / rgw / rgw_rest_role.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #ifndef CEPH_RGW_REST_ROLE_H
4 #define CEPH_RGW_REST_ROLE_H
5
6 class RGWRestRole : public RGWOp {
7 protected:
8   string role_name;
9   string role_path;
10   string trust_policy;
11   string policy_name;
12   string perm_policy;
13   string path_prefix;
14
15 public:
16   void send_response() override;
17 };
18
19 class RGWRoleRead : public RGWRestRole {
20 public:
21   RGWRoleRead() = default;
22   int verify_permission() override;
23   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
24 };
25
26 class RGWRoleWrite : public RGWRestRole {
27 public:
28   RGWRoleWrite() = default;
29   int verify_permission() override;
30   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
31 };
32
33 class RGWCreateRole : public RGWRoleWrite {
34 public:
35   RGWCreateRole() = default;
36   void execute() override;
37   int get_params();
38   const string name() override { return "create_role"; }
39   RGWOpType get_type() override { return RGW_OP_CREATE_ROLE; }
40 };
41
42 class RGWDeleteRole : public RGWRoleWrite {
43 public:
44   RGWDeleteRole() = default;
45   void execute() override;
46   int get_params();
47   const string name() override { return "delete_role"; }
48   RGWOpType get_type() override { return RGW_OP_DELETE_ROLE; }
49 };
50
51 class RGWGetRole : public RGWRoleRead {
52 public:
53   RGWGetRole() = default;
54   void execute() override;
55   int get_params();
56   const string name() override { return "get_role"; }
57   RGWOpType get_type() override { return RGW_OP_GET_ROLE; }
58 };
59
60 class RGWModifyRole : public RGWRoleWrite {
61 public:
62   RGWModifyRole() = default;
63   void execute() override;
64   int get_params();
65   const string name() override { return "modify_role"; }
66   RGWOpType get_type() override { return RGW_OP_MODIFY_ROLE; }
67 };
68
69 class RGWListRoles : public RGWRoleRead {
70 public:
71   RGWListRoles() = default;
72   void execute() override;
73   int get_params();
74   const string name() override { return "list_roles"; }
75   RGWOpType get_type() override { return RGW_OP_LIST_ROLES; }
76 };
77
78 class RGWPutRolePolicy : public RGWRoleWrite {
79 public:
80   RGWPutRolePolicy() = default;
81   void execute() override;
82   int get_params();
83   const string name() override { return "put_role_policy"; }
84   RGWOpType get_type() override { return RGW_OP_PUT_ROLE_POLICY; }
85 };
86
87 class RGWGetRolePolicy : public RGWRoleRead {
88 public:
89   RGWGetRolePolicy() = default;
90   void execute() override;
91   int get_params();
92   const string name() override { return "get_role_policy"; }
93   RGWOpType get_type() override { return RGW_OP_GET_ROLE_POLICY; }
94 };
95
96 class RGWListRolePolicies : public RGWRoleRead {
97 public:
98   RGWListRolePolicies() = default;
99   void execute() override;
100   int get_params();
101   const string name() override { return "list_role_policies"; }
102   RGWOpType get_type() override { return RGW_OP_LIST_ROLE_POLICIES; }
103 };
104
105 class RGWDeleteRolePolicy : public RGWRoleWrite {
106 public:
107   RGWDeleteRolePolicy() = default;
108   void execute() override;
109   int get_params();
110   const string name() override { return "delete_role_policy"; }
111   RGWOpType get_type() override { return RGW_OP_DELETE_ROLE_POLICY; }
112 };
113 #endif /* CEPH_RGW_REST_ROLE_H */
114