OW_SimpleAuthorizer2.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Novell, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Novell, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00035 #ifndef OW_SIMPLE_AUTHORIZER2_HPP_INCLUDE_GUARD_
00036 #define OW_SIMPLE_AUTHORIZER2_HPP_INCLUDE_GUARD_
00037 #include "OW_config.h"
00038 #include "OW_Authorizer2IFC.hpp"
00039 
00040 namespace OW_NAMESPACE
00041 {
00042 
00043 // This class is responsible for Access control.
00044 class SimpleAuthorizer2 : public Authorizer2IFC
00045 {
00046 public:
00050    SimpleAuthorizer2();
00054    virtual ~SimpleAuthorizer2();
00055 
00079    virtual bool doAllowReadInstance(
00080       const ServiceEnvironmentIFCRef& env,
00081         const String& ns,
00082       const String& className,
00083       const StringArray* clientPropertyList,
00084       StringArray& authorizedPropertyList,
00085       OperationContext& context);
00086 
00087 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00088 
00100    virtual bool doAllowWriteInstance(
00101       const ServiceEnvironmentIFCRef& env,
00102       const String& ns, 
00103       const CIMObjectPath& instanceName, 
00104       EDynamicFlag dynamic,
00105       EWriteFlag flag,
00106       OperationContext& context);
00107 #endif
00108 
00115    virtual bool doAllowReadSchema(
00116       const ServiceEnvironmentIFCRef& env,
00117       const String& ns,
00118       OperationContext& context);
00119 
00120 #if !defined(OW_DISABLE_SCHEMA_MANIPULATION) || !defined(OW_DISABLE_QUALIFIER_DECLARATION)
00121 
00129    virtual bool doAllowWriteSchema(
00130       const ServiceEnvironmentIFCRef& env,
00131       const String& ns,
00132       EWriteFlag flag,
00133       OperationContext& context);
00134 
00135 #endif
00136 
00144    virtual bool doAllowAccessToNameSpace(
00145       const ServiceEnvironmentIFCRef& env,
00146       const String& ns,
00147       Authorizer2IFC::EAccessType actype,
00148       OperationContext& context);
00149 
00150 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00151 
00157    virtual bool doAllowCreateNameSpace(
00158       const ServiceEnvironmentIFCRef& env,
00159       const String& ns,
00160       OperationContext& context);
00161 
00168    virtual bool doAllowDeleteNameSpace(
00169       const ServiceEnvironmentIFCRef& env,
00170       const String& ns,
00171       OperationContext& context);
00172 #endif
00173 
00179    virtual bool doAllowEnumNameSpace(
00180       const ServiceEnvironmentIFCRef& env,
00181       OperationContext& context);
00182 
00192    virtual bool doAllowMethodInvocation(
00193       const ServiceEnvironmentIFCRef& env, 
00194       const String& ns, 
00195       const CIMObjectPath& path, 
00196       const String& MethodName,
00197       OperationContext& context);
00198 
00199 private:
00200 
00201    bool checkAccess(const String& opType, const String& ns,
00202       const ServiceEnvironmentIFCRef& env,
00203       OperationContext& context);
00204 };
00205 
00206 } // end namespace OW_NAMESPACE
00207 
00208 #endif

Generated on Thu Feb 9 08:48:11 2006 for openwbem by  doxygen 1.4.6