00001 #ifndef _FDODBUSERREADER_H_
00002 #define _FDODBUSERREADER_H_
00003
00004 /*
00005 * Copyright (C) 2004-2006 Autodesk, Inc.
00006 *
00007 * This library is free software; you can redistribute it and/or
00008 * modify it under the terms of version 2.1 of the GNU Lesser
00009 * General Public License as published by the Free Software Foundation.
00010 *
00011 * This library is distributed in the hope that it will be useful,
00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00014 * Lesser General Public License for more details.
00015 *
00016 * You should have received a copy of the GNU Lesser General Public
00017 * License along with this library; if not, write to the Free Software
00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00019 *
00020 * Revision Control Modification History
00021 *
00022 * $Id: //fdo_depot/Providers/Utilities/UserMgr/inc/Utilities/UserMgr/FdoDbUserReader.h#1 $
00023 * $Author: lee $
00024 * $DateTime: 2007/04/16 11:56:21 $
00025 * $Change: 15040 $
00026 *
00027 */
00028
00029 #ifdef _WIN32
00030 #pragma once
00031 #endif
00032
00033 #include <Fdo.h>
00034 #include <Utilities/FdoUserMgr.h>
00035
00036 class FdoDbUserReader : public FdoIDisposable
00037 {
00038
00039 public:
00040
00041 /// <summary>Advances the reader to the next item and returns true if there is
00042 /// another object to read or false if reading is complete. The default
00043 /// position of the reader is prior to the first item. Thus you must
00044 /// call ReadNext to begin accessing any data.</summary>
00045 /// <returns>Returns true if there is a next item.</returns>
00046 FDOUSERMGR_API virtual bool ReadNext();
00047
00048 /// <summary> Get the user name. </summary>
00049 /// <returns>Returns the name of the user.</returns>
00050 FDOUSERMGR_API virtual FdoString* GetName();
00051
00052 /// <summary> Get the Windows domain name. Empty if not SQL Server Windows authenticated user. </summary>
00053 /// <returns>Returns the Windows domain name.</returns>
00054 FDOUSERMGR_API virtual FdoString* GetDomain() = 0;
00055
00056 /// <summary> List of the roles or privileges assigned to the user.</summary>
00057 /// <returns>Returns the collection of roles or privileges.</returns>
00058 FDOUSERMGR_API virtual FdoStringCollection* GetRolesOrPrivileges(FdoString* datastore) = 0;
00059 FDOUSERMGR_API virtual FdoStringCollection* GetRolesOrPrivileges() = 0;
00060
00061
00062 protected:
00063
00064 FdoDbUserReader();
00065
00066 FdoDbUserReader( FdoIConnection* connection, FdoISQLDataReader *sqlReader);
00067
00068 ~FdoDbUserReader();
00069
00070 void Dispose();
00071
00072 protected:
00073 FdoIConnection *mFdoConnection;
00074 FdoPtr<FdoISQLDataReader> mSqlReader;
00075 FdoStringP mUserName;
00076 FdoStringP mDomain;
00077 };
00078
00079 #endif