Statistics
| Branch: | Tag: | Revision:

one / include / RequestManagerAcl.h @ bfaabf35

History | View | Annotate | Download (3.99 KB)

1
/* -------------------------------------------------------------------------- */
2
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             */
3
/*                                                                            */
4
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
5
/* not use this file except in compliance with the License. You may obtain    */
6
/* a copy of the License at                                                   */
7
/*                                                                            */
8
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
9
/*                                                                            */
10
/* Unless required by applicable law or agreed to in writing, software        */
11
/* distributed under the License is distributed on an "AS IS" BASIS,          */
12
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
13
/* See the License for the specific language governing permissions and        */
14
/* limitations under the License.                                             */
15
/* -------------------------------------------------------------------------- */
16

    
17
#ifndef REQUEST_MANAGER_ACL_H
18
#define REQUEST_MANAGER_ACL_H
19

    
20
#include "Request.h"
21
#include "Nebula.h"
22

    
23
using namespace std;
24

    
25
/* ------------------------------------------------------------------------- */
26
/* ------------------------------------------------------------------------- */
27
/* ------------------------------------------------------------------------- */
28

    
29
class RequestManagerAcl: public Request
30
{
31
protected:
32
    RequestManagerAcl( const string& method_name,
33
                       const string& help,
34
                       const string& params)
35
        :Request(method_name,params,help)
36
    {
37
        auth_object = AuthRequest::ACL;
38
    };
39

    
40
    ~RequestManagerAcl(){};
41

    
42
    /* -------------------------------------------------------------------- */
43

    
44
    virtual void request_execute(xmlrpc_c::paramList const& _paramList);
45

    
46
    /* -------------------------------------------------------------------- */
47

    
48
    virtual int perform_operation(string& error_msg)
49
    {
50
        return 0;
51
    };
52

    
53
    /* -------------------------------------------------------------------- */
54

    
55
    long long user;
56
    long long resource;
57
    long long rights;
58

    
59
    AclManager * aclm;
60
};
61

    
62
/* ------------------------------------------------------------------------- */
63
/* ------------------------------------------------------------------------- */
64

    
65
class AclAddRule : public RequestManagerAcl
66
{
67
public:
68
    AclAddRule():
69
        RequestManagerAcl("AclAddRule",
70
                            "Adds a new ACL rule",
71
                            "A:ssss")
72
    {
73
        // TODO: auth_op ?
74
    };
75

    
76
    ~AclAddRule(){};
77

    
78
    int perform_operation(string& error_msg);
79
};
80

    
81
/* ------------------------------------------------------------------------- */
82
/* ------------------------------------------------------------------------- */
83

    
84
class AclDelRule : public RequestManagerAcl
85
{
86
public:
87
    AclDelRule():
88
        RequestManagerAcl("AclDelRule",
89
                            "Deletes an existing ACL rule",
90
                            "A:ssss")
91
    {
92
        // TODO: auth_op ?
93
    };
94

    
95
    ~AclDelRule(){};
96

    
97
    int perform_operation(string& error_msg);
98
};
99

    
100
/* ------------------------------------------------------------------------- */
101
/* ------------------------------------------------------------------------- */
102

    
103
class AclInfo: public RequestManagerAcl
104
{
105
public:
106
    AclInfo():
107
        RequestManagerAcl("AclInfo",
108
                            "Returns the ACL rule set",
109
                            "A:s")
110
    {
111
        // TODO: auth_op ?
112
    };
113

    
114
    ~AclInfo(){};
115

    
116
    void request_execute(xmlrpc_c::paramList const& _paramList);
117
};
118

    
119
/* -------------------------------------------------------------------------- */
120
/* -------------------------------------------------------------------------- */
121
/* -------------------------------------------------------------------------- */
122

    
123
#endif