00001 /*
00002 * Copyright (C) 2004-2006 Autodesk, Inc.
00003 *
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 *
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011 * Lesser General Public License for more details.
00012 *
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00016 *
00017 * Revision Control Modification History
00018 *
00019 * $Id: //Providers/Utilities/UserMgr/inc/Utilities/UserMgr/FdoUserManager.h#1 $
00020 * $Author: ds $
00021 * $DateTime: 2005/12/05 11:20:19 $
00022 * $Change: 9547 $
00023 *
00024 */
00025
00026 #pragma once
00027
00028 #include "mgIUserManager.h"
00029
00030 class FdoUserManager;
00031
00032 BEGIN_NAMESPACE_AUTODESK_FDO_FDO_UTILITIES_USERMGR
00033
00034 public __gc class IUserManagerImp : public NAMESPACE_OSGEO_RUNTIME::Disposable, public NAMESPACE_AUTODESK_FDO_FDO_UTILITIES_USERMGR::IUserManager
00035 {
00036 public:
00037 /// <summary> Creates an instance of this class can be used to dynamically manage the users of a datasource. <\summary>
00038 /// <param name="connection">Input the connection </param>
00039 /// <returns> Returns an instance of this class <\returns>
00040 IUserManagerImp(NAMESPACE_OSGEO_FDO_CONNECTIONS::IConnectionImp *connection);
00041
00042 /// <summary> SQL Server and MySQL use explicit grants to datastores. <\summary>
00043 /// <returns> Returns true if the RDBMS use explicit grants <\returns>
00044 System::Boolean SupportsDatastoreGrants();
00045
00046 /// <summary> SQL Server can use Windows authenticated users. <\summary>
00047 /// <returns> Returns true if the RDBMS use Windows authenticated users.<\returns>
00048 System::Boolean SupportsWindowsAuthentication();
00049
00050 /// <summary> Adds a new user to the RDBMS. <\summary>
00051 /// <param name="name">Input the user name</param>
00052 /// <param name="password">Input the user's password </param>
00053 /// <returns> Returns nothing <\returns>
00054 System::Void AddUser( System::String* name, System::String* password);
00055
00056 /// <summary> Supported by SQL Server. Adds a Windows user to the server. <\summary>
00057 /// <param name="domain">Input the Windows domain name</param>
00058 /// <param name="name">Input the user name</param>
00059 /// <returns> Returns nothing <\returns>
00060 System::Void ApplyWindowsUser(System::String* domain, System::String* name);
00061
00062 /// <summary> Removes an user from RDBMS. <\summary>
00063 /// <param name="name">Input the user name</param>
00064 /// <returns> Returns nothing <\returns>
00065 System::Void DropUser(System::String* name);
00066
00067 /// <summary> Supported by Oracle. Assigns a role to the specified user. <\summary>
00068 /// <param name="name">Input the user name</param>
00069 /// <param name="roleOrPrivilege">Input the role name. </param>
00070 /// <returns> Returns nothing <\returns>
00071 System::Void AssignRoleOrPrivilege(System::String* name, System::String* roleOrPrivilege);
00072
00073 /// <summary> Supported by Oracle. Revokes a role from the specified user. <\summary>
00074 /// <param name="name">Input the user name</param>
00075 /// <param name="roleOrPrivilege">Input the role name. </param>
00076 /// <returns> Returns nothing <\returns>
00077 System::Void RevokeRoleOrPrivilege(System::String* name, System::String* roleOrPrivilege);
00078
00079 /// <summary> Supported by SQL Server and MySQL. Grants explicit access to a dataStore with the default privileges. <\summary>
00080 /// <param name="name">Input the user name</param>
00081 /// <param name="dataStore">Input the dataStore name</param>
00082 /// <returns> Returns nothing <\returns>
00083 System::Void GrantAccessToDatastore(System::String* name, System::String* dataStore);
00084
00085 /// <summary> Supported by SQL Server and MySQL. Grants access to a dataStore with the specified privilege. <\summary>
00086 /// <param name="name">Input the user name</param>
00087 /// <param name="dataStore">Input the dataStore name</param>
00088 /// <param name="roleOrPrivilege">Input the privilege name. </param>
00089 /// <returns> Returns nothing <\returns>
00090 System::Void GrantAccessToDatastore(System::String* name, System::String* dataStore, System::String* roleOrPrivilege);
00091
00092 /// <summary> Supported by SQL Server and MySQL. Revokes an access privilege against a database. <\summary>
00093 /// <param name="name">Input the user name</param>
00094 /// <param name="dataStore">Input the dataStore name</param>
00095 /// <param name="roleOrPrivilege">Input the privilege name. </param>
00096 /// <returns> Returns nothing <\returns>
00097 System::Void RevokeAccessToDatastore(System::String* name, System::String* dataStore, System::String* roleOrPrivilege);
00098
00099 ///// <summary> Gets a reader over all RDBMS users. <\summary>
00100 ///// <returns> Returns the reader <\returns>
00101 NAMESPACE_AUTODESK_FDO_FDO_UTILITIES_USERMGR::DbUserReader* GetDbUsers();
00102
00103 /// <summary> Supported by SQL Server and MySQL. Gets a reader over the users of a specific dataStore. <\summary>
00104 /// <param name="dataStore">Input the dataStore name</param>
00105 /// <returns> Returns the reader <\returns>
00106 NAMESPACE_AUTODESK_FDO_FDO_UTILITIES_USERMGR::DbUserReader* GetDbUsers(System::String* dataStore);
00107
00108 /// <summary> Gets the list of the datastores. <\summary>
00109 /// <returns> Returns the list of datastores <\returns>
00110 NAMESPACE_OSGEO_COMMON::StringCollection* GetDatastores(System::Boolean includeAllDataStores);
00111
00112 /// <summary> Gets the list of supported Roles or Privileges. <\summary>
00113 /// <returns> Returns the list of supported Roles or Privileges. <\returns>
00114 NAMESPACE_OSGEO_COMMON::StringCollection* GetRolesOrPrivileges();
00115
00116 protected:
00117 System::Void ReleaseUnmanagedObject();
00118
00119 public private:
00120 inline FdoUserManager* GetImpObj();
00121 };
00122
00123 END_NAMESPACE_AUTODESK_FDO_FDO_UTILITIES_USERMGR
00124