2011-06-22 21:22:52 +04:00
/* -------------------------------------------------------------------------- */
2012-01-12 15:29:18 +04:00
/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */
2011-06-22 21:22:52 +04:00
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
# ifndef REQUEST_MANAGER_ACL_H
# define REQUEST_MANAGER_ACL_H
# include "Request.h"
# include "Nebula.h"
using namespace std ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerAcl : public Request
{
protected :
RequestManagerAcl ( const string & method_name ,
const string & help ,
const string & params )
: Request ( method_name , params , help )
{
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : ACL ;
2011-06-30 17:17:58 +04:00
auth_op = AuthRequest : : MANAGE ;
2011-07-04 00:52:21 +04:00
Nebula & nd = Nebula : : instance ( ) ;
aclm = nd . get_aclm ( ) ;
2011-06-22 21:22:52 +04:00
} ;
~ RequestManagerAcl ( ) { } ;
/* -------------------------------------------------------------------- */
2011-07-07 14:45:13 +04:00
virtual void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) = 0 ;
2011-06-22 21:22:52 +04:00
/* -------------------------------------------------------------------- */
AclManager * aclm ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclAddRule : public RequestManagerAcl
{
public :
AclAddRule ( ) :
RequestManagerAcl ( " AclAddRule " ,
2011-07-04 00:52:21 +04:00
" Adds a new ACL rule " ,
" A:ssss " )
2011-06-30 17:17:58 +04:00
{ } ;
2011-06-22 21:22:52 +04:00
~ AclAddRule ( ) { } ;
2011-07-07 14:45:13 +04:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2011-06-22 21:22:52 +04:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclDelRule : public RequestManagerAcl
{
public :
AclDelRule ( ) :
RequestManagerAcl ( " AclDelRule " ,
2011-07-04 00:52:21 +04:00
" Deletes an existing ACL rule " ,
" A:si " )
2011-06-30 17:17:58 +04:00
{ } ;
2011-06-22 21:22:52 +04:00
~ AclDelRule ( ) { } ;
2011-07-07 14:45:13 +04:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2011-06-22 21:22:52 +04:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclInfo : public RequestManagerAcl
{
public :
AclInfo ( ) :
RequestManagerAcl ( " AclInfo " ,
2011-07-04 00:52:21 +04:00
" Returns the ACL rule set " ,
" A:s " )
2011-06-30 17:17:58 +04:00
{ } ;
2011-06-22 21:22:52 +04:00
~ AclInfo ( ) { } ;
2011-07-07 14:45:13 +04:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2011-06-22 21:22:52 +04:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif