2011-06-22 19:22:52 +02:00
/* -------------------------------------------------------------------------- */
2024-07-29 14:25:20 +02:00
/* Copyright 2002-2024, OpenNebula Project, OpenNebula Systems */
2011-06-22 19:22:52 +02: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"
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerAcl : public Request
{
protected :
2020-07-02 22:42:10 +02:00
RequestManagerAcl ( const std : : string & method_name ,
const std : : string & help ,
const std : : string & params )
2024-06-03 11:40:24 +02:00
: Request ( method_name , params , help )
2011-06-22 19:22:52 +02:00
{
2012-01-03 02:58:23 +01:00
auth_object = PoolObjectSQL : : ACL ;
2011-06-30 15:17:58 +02:00
auth_op = AuthRequest : : MANAGE ;
2011-07-03 22:52:21 +02:00
Nebula & nd = Nebula : : instance ( ) ;
aclm = nd . get_aclm ( ) ;
2011-06-22 19:22:52 +02:00
} ;
2024-06-03 11:40:24 +02:00
~ RequestManagerAcl ( ) { } ;
2011-06-22 19:22:52 +02:00
/* -------------------------------------------------------------------- */
AclManager * aclm ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclAddRule : public RequestManagerAcl
{
public :
AclAddRule ( ) :
2017-05-07 21:52:34 +02:00
RequestManagerAcl ( " one.acl.addrule " ,
2011-07-03 22:52:21 +02:00
" Adds a new ACL rule " ,
" A:ssss " )
2011-06-30 15:17:58 +02:00
{ } ;
2011-06-22 19:22:52 +02:00
2024-06-03 11:40:24 +02:00
~ AclAddRule ( ) { } ;
2011-06-22 19:22:52 +02:00
2011-07-07 12:45:13 +02:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2019-07-05 17:23:21 +02:00
RequestAttributes & att ) override ;
2011-06-22 19:22:52 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclDelRule : public RequestManagerAcl
{
public :
AclDelRule ( ) :
2017-05-07 21:52:34 +02:00
RequestManagerAcl ( " one.acl.delrule " ,
2011-07-03 22:52:21 +02:00
" Deletes an existing ACL rule " ,
" A:si " )
2011-06-30 15:17:58 +02:00
{ } ;
2011-06-22 19:22:52 +02:00
2024-06-03 11:40:24 +02:00
~ AclDelRule ( ) { } ;
2011-06-22 19:22:52 +02:00
2011-07-07 12:45:13 +02:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2019-07-05 17:23:21 +02:00
RequestAttributes & att ) override ;
2011-06-22 19:22:52 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class AclInfo : public RequestManagerAcl
{
public :
AclInfo ( ) :
2017-05-07 21:52:34 +02:00
RequestManagerAcl ( " one.acl.info " ,
2011-07-03 22:52:21 +02:00
" Returns the ACL rule set " ,
" A:s " )
2011-06-30 15:17:58 +02:00
{ } ;
2011-06-22 19:22:52 +02:00
2024-06-03 11:40:24 +02:00
~ AclInfo ( ) { } ;
2011-06-22 19:22:52 +02:00
2011-07-07 12:45:13 +02:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2019-07-05 17:23:21 +02:00
RequestAttributes & att ) override ;
2011-06-22 19:22:52 +02:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif