2012-01-04 20:14:09 +01:00
/* -------------------------------------------------------------------------- */
2015-09-23 15:03:22 +02:00
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
2012-01-04 20:14:09 +01: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_CHMOD_H_
# define REQUEST_MANAGER_CHMOD_H_
# include "Request.h"
# include "Nebula.h"
using namespace std ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerChmod : public Request
{
protected :
RequestManagerChmod ( const string & method_name ,
2012-06-13 12:44:04 +02:00
const string & help )
: Request ( method_name , " A:siiiiiiiiii " , help ) { } ;
2012-01-04 20:14:09 +01:00
2016-02-08 16:40:38 +01:00
RequestManagerChmod ( const string & method_name ,
const string & params ,
const string & help )
: Request ( method_name , params , help ) { } ;
2012-01-04 20:14:09 +01:00
~ RequestManagerChmod ( ) { } ;
/* -------------------------------------------------------------------- */
virtual void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2016-02-08 16:40:38 +01:00
static ErrorCode chmod ( PoolSQL * pool ,
int oid ,
int owner_u ,
int owner_m ,
int owner_a ,
int group_u ,
int group_m ,
int group_a ,
int other_u ,
int other_m ,
int other_a ,
RequestAttributes & att ) ;
2012-01-04 20:14:09 +01:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualMachineChmod : public RequestManagerChmod
{
public :
VirtualMachineChmod ( ) :
RequestManagerChmod ( " VirtualMachineChmod " ,
2012-01-18 18:13:19 +01:00
" Changes permission bits of a virtual machine " )
2015-07-01 15:15:40 -04:00
{
2012-01-04 20:14:09 +01:00
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_vmpool ( ) ;
auth_object = PoolObjectSQL : : VM ;
} ;
~ VirtualMachineChmod ( ) { } ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class TemplateChmod : public RequestManagerChmod
{
public :
2012-06-08 11:43:55 +02:00
TemplateChmod ( ) :
2012-01-04 20:14:09 +01:00
RequestManagerChmod ( " TemplateChmod " ,
2016-02-08 16:40:38 +01:00
" A:siiiiiiiiiib "
2012-01-18 18:13:19 +01:00
" Changes permission bits of a virtual machine template " )
2015-07-01 15:15:40 -04:00
{
2012-01-04 20:14:09 +01:00
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_tpool ( ) ;
auth_object = PoolObjectSQL : : TEMPLATE ;
} ;
~ TemplateChmod ( ) { } ;
2016-02-08 16:40:38 +01:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2012-01-04 20:14:09 +01:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualNetworkChmod : public RequestManagerChmod
{
public :
VirtualNetworkChmod ( ) :
RequestManagerChmod ( " VirtualNetworkChmod " ,
2012-01-18 18:13:19 +01:00
" Changes permission bits of a virtual network " )
2015-07-01 15:15:40 -04:00
{
2012-01-04 20:14:09 +01:00
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_vnpool ( ) ;
auth_object = PoolObjectSQL : : NET ;
} ;
~ VirtualNetworkChmod ( ) { } ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class ImageChmod : public RequestManagerChmod
{
public :
ImageChmod ( ) :
RequestManagerChmod ( " ImageChmod " ,
2012-01-18 18:13:19 +01:00
" Changes permission bits of an image " )
2015-07-01 15:15:40 -04:00
{
2012-01-04 20:14:09 +01:00
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_ipool ( ) ;
auth_object = PoolObjectSQL : : IMAGE ;
} ;
~ ImageChmod ( ) { } ;
2016-02-08 16:40:38 +01:00
static ErrorCode chmod ( int oid ,
int owner_u ,
int owner_m ,
int owner_a ,
int group_u ,
int group_m ,
int group_a ,
int other_u ,
int other_m ,
int other_a ,
RequestAttributes & att ) ;
2012-01-04 20:14:09 +01:00
} ;
2012-03-02 16:11:50 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DatastoreChmod : public RequestManagerChmod
{
public :
DatastoreChmod ( ) :
RequestManagerChmod ( " DatastoreChmod " ,
" Changes permission bits of a datastore " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_dspool ( ) ;
auth_object = PoolObjectSQL : : DATASTORE ;
} ;
~ DatastoreChmod ( ) { } ;
} ;
2012-06-08 16:00:16 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DocumentChmod : public RequestManagerChmod
{
public :
DocumentChmod ( ) :
RequestManagerChmod ( " DocumentChmod " ,
2012-06-13 12:44:04 +02:00
" Changes permission bits of a generic document " )
2012-06-08 16:00:16 +02:00
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_docpool ( ) ;
auth_object = PoolObjectSQL : : DOCUMENT ;
} ;
~ DocumentChmod ( ) { } ;
} ;
2012-06-13 12:44:04 +02:00
2014-09-08 11:50:25 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class SecurityGroupChmod : public RequestManagerChmod
{
public :
SecurityGroupChmod ( ) :
RequestManagerChmod ( " SecurityGroupChmod " ,
" Changes permission bits of a security group " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_secgrouppool ( ) ;
auth_object = PoolObjectSQL : : SECGROUP ;
} ;
~ SecurityGroupChmod ( ) { } ;
} ;
2015-11-30 16:50:23 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualRouterChmod : public RequestManagerChmod
{
public :
VirtualRouterChmod ( ) :
RequestManagerChmod ( " VirtualRouterChmod " ,
" Changes permission bits of a virtual router " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_vrouterpool ( ) ;
auth_object = PoolObjectSQL : : VROUTER ;
} ;
~ VirtualRouterChmod ( ) { } ;
} ;
2015-12-05 23:52:28 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class MarketPlaceChmod : public RequestManagerChmod
{
public :
MarketPlaceChmod ( ) :
RequestManagerChmod ( " MarketPlaceChmod " ,
" Changes permission bits of a marketplace " )
{
Nebula & nd = Nebula : : instance ( ) ;
2015-12-11 15:53:19 +01:00
pool = nd . get_marketpool ( ) ;
2015-12-05 23:52:28 +01:00
auth_object = PoolObjectSQL : : MARKETPLACE ;
} ;
~ MarketPlaceChmod ( ) { } ;
} ;
2015-12-11 15:53:19 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class MarketPlaceAppChmod : public RequestManagerChmod
{
public :
MarketPlaceAppChmod ( ) :
RequestManagerChmod ( " MarketPlaceAppChmod " ,
" Changes permission bits of a marketplace app " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_apppool ( ) ;
auth_object = PoolObjectSQL : : MARKETPLACEAPP ;
} ;
~ MarketPlaceAppChmod ( ) { } ;
} ;
2012-01-04 20:14:09 +01:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif