Autodesk FDO Data Management Utility API Reference

Autodesk FDO Data Management Utility

API Reference Autodesk FDO Data Management Utility

FdoUserManager.h

Go to the documentation of this file.
00001 #ifndef _FDOUSERMANAGER_H_
00002 #define _FDOUSERMANAGER_H_
00003 /*
00004  * Copyright (C) 2004-2006  Autodesk, Inc.
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of version 2.1 of the GNU Lesser
00008  * General Public License as published by the Free Software Foundation.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  *
00019  * Revision Control Modification History
00020  *
00021  *         $Id: //fdo_depot/Providers/Utilities/UserMgr/inc/Utilities/UserMgr/FdoUserManager.h#1 $
00022  *     $Author: lee $
00023  *   $DateTime: 2007/04/16 11:56:21 $
00024  *     $Change: 15040 $
00025  *
00026  */
00027 
00028 #ifdef _WIN32
00029 #pragma once
00030 #endif
00031 
00032 #include <Utilities/FdoUserMgr.h>
00033 
00034 #include <Fdo.h>
00035 #include <Common/IDisposable.h>
00036 #include <Fdo/Connections/IConnection.h>
00037 #include "FdoDbUserReader.h"
00038 
00039 #define UM_SUPPORTED_PROVIDER_MIN_VERSION       3   
00040 
00041 class FdoUserManager : public FdoIDisposable
00042 {
00043 public:
00044 
00045     /// <summary> Creates an instance of this class that can be used to dynamically manage the users of a datasource. <\summary> 
00046     /// <param name="connection">Input the connection </param> 
00047     /// <returns> Returns an instance of this class <\returns>
00048     FDOUSERMGR_API static FdoUserManager*  Create(FdoIConnection *connection);
00049 
00050     /// <summary> SQL Server and MySQL use explicit grants to datastores. <\summary> 
00051     /// <returns> Returns true if the RDBMS use explicit grants <\returns>
00052     FDOUSERMGR_API virtual bool SupportsDatastoreGrants() = 0;
00053 
00054     /// <summary> SQL Server can use Windows authenticated users. <\summary> 
00055     /// <returns> Returns true if the RDBMS use Windows authenticated users.<\returns>
00056     FDOUSERMGR_API virtual bool SupportsWindowsAuthentication() = 0;
00057 
00058     /// <summary> Adds a new user to the RDBMS. <\summary> 
00059     /// <param name="name">Input the user name</param> 
00060     /// <param name="password">Input the user's password </param> 
00061     /// <returns> Returns nothing <\returns>
00062     FDOUSERMGR_API virtual void AddUser( FdoString* name, FdoString *password) = 0;
00063 
00064     /// <summary> Supported by SQL Server. Adds a Windows user to the server. <\summary> 
00065     /// <param name="domain">Input the Windows domain name</param> 
00066     /// <param name="name">Input the user name</param> 
00067     /// <returns> Returns nothing <\returns>
00068     FDOUSERMGR_API virtual void ApplyWindowsUser(FdoString* domain, FdoString* name) = 0;
00069 
00070     /// <summary> Removes a user from the RDBMS. <\summary> 
00071     /// <param name="name">Input the user name</param> 
00072     /// <returns> Returns nothing <\returns>
00073     FDOUSERMGR_API virtual void DropUser(FdoString* name) = 0;
00074 
00075     /// <summary> Supported by Oracle and MySQL. Assigns a role to the specified user.
00076     /// In MySQL this assigns the role to the specified user in all datastores.<\summary> 
00077     /// <param name="name">Input the user name</param> 
00078     /// <param name="roleOrPrivilege">Input the role name. </param> 
00079     /// <returns> Returns nothing <\returns>
00080     FDOUSERMGR_API virtual void AssignRoleOrPrivilege(FdoString* name, FdoString* roleOrPrivilege) = 0;
00081 
00082     /// <summary> Supported by Oracle and MySQL. Revokes a role from the specified user.
00083     /// In MySQL this revokes the role from the specified user in all datastores.<\summary> 
00084     /// <param name="name">Input the user name</param> 
00085     /// <param name="roleOrPrivilege">Input the role name. </param> 
00086     /// <returns> Returns nothing <\returns>
00087     FDOUSERMGR_API virtual void RevokeRoleOrPrivilege(FdoString* name, FdoString* roleOrPrivilege) = 0;
00088 
00089     /// <summary> Supported by SQL Server and MySQL. Grants explicit access to a datastore with the default privileges. <\summary> 
00090     /// <param name="name">Input the user name</param> 
00091     /// <param name="datastore">Input the datastore name</param> 
00092     /// <returns> Returns nothing <\returns>
00093     FDOUSERMGR_API virtual void GrantAccessToDatastore(FdoString* name, FdoString* datastore) = 0;
00094 
00095     /// <summary> Supported by SQL Server and MySQL. Grants access to a datastore with the specified privilege. <\summary> 
00096     /// <param name="name">Input the user name</param> 
00097     /// <param name="datastore">Input the datastore name</param> 
00098     /// <param name="roleOrPrivilege">Input the privilege name. </param> 
00099     /// <returns> Returns nothing <\returns>
00100     FDOUSERMGR_API virtual void GrantAccessToDatastore(FdoString* name, FdoString* datastore, FdoString* roleOrPrivilege) = 0;
00101 
00102     /// <summary> Supported by SQL Server and MySQL. Revokes an access privilege against a datastore.
00103     /// If roleOrPrivilege is set to '*', all roles or privileges are revoked from the specified user; on SQL Server
00104     /// this will also remove the user from that datastore.<\summary> 
00105     /// <param name="name">Input the user name</param> 
00106     /// <param name="datastore">Input the datastore name</param> 
00107     /// <param name="roleOrPrivilege">Input the privilege name. </param>    
00108     /// <returns> Returns nothing <\returns>
00109     FDOUSERMGR_API virtual void RevokeAccessToDatastore(FdoString* name, FdoString* datastore, FdoString* roleOrPrivilege) = 0;
00110 
00111     /// <summary> Gets a reader over all RDBMS users. <\summary> 
00112     /// <returns> Returns the reader <\returns>
00113     FDOUSERMGR_API virtual FdoDbUserReader* GetDbUsers() = 0;
00114 
00115     /// <summary> Supported by SQL Server and MySQL. Gets a reader over the users of a specific datastore. <\summary> 
00116     /// <param name="datastore">Input the datastore name</param> 
00117     /// <returns> Returns the reader <\returns>
00118     FDOUSERMGR_API virtual FdoDbUserReader* GetDbUsers(FdoString* datastore) = 0;
00119 
00120     /// <summary> Gets the list of the datastores. <\summary> 
00121     /// <returns> Returns the list of datastores <\returns>
00122     FDOUSERMGR_API virtual FdoStringCollection* GetDatastores(bool bIncludeNonFdoEnabledDatastores = false);
00123 
00124     /// <summary> Gets the list of supported Roles or Privileges. <\summary> 
00125     /// <returns> Returns the list of supported Roles or Privileges. <\returns>
00126     FDOUSERMGR_API virtual FdoStringCollection* GetRolesOrPrivileges() = 0;
00127 
00128 protected:
00129     FdoUserManager();  // Define an explicit protected constructor, to avoid having an implicit public constructor.
00130     virtual void Dispose();
00131 
00132     FdoIConnection          *mFdoConnection;
00133     FdoPtr<FdoISQLCommand>  mSqlCmd;
00134     FdoStringsP             mRolesOrPrivileges;
00135 };
00136 
00137 #endif

Comments?