Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

ODBCSecurityPlugin.h

00001 /*
00002    Copyright (C) 2002 - 2003 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008  
00009    @author Wouter de Vries
00010    @author Ewald Snel
00011 */ 
00012 
00013 #ifndef __ODBCSECURITYPLUGIN_H
00014 #define __ODBCSECURITYPLUGIN_H
00015 
00016 #include <string>
00017 
00018 #include <SecurityPlugin.h>
00019 #include <ODBCConnection.h>
00020 #include <ODBCQuery.h>
00021 
00022 
00058 class ODBCSecurityPlugin : public SecurityPlugin
00059 {
00060 public:
00061 
00062     ODBCSecurityPlugin( const Config &cfg );
00063     ~ODBCSecurityPlugin();
00064 
00065     bool init();
00066 
00067     void getLoginChallenge( string username, string &challenge );
00068 
00069     bool hasReadPermission( NumID userid, NumID docid );
00070     bool hasWritePermission( NumID userid, NumID docid );
00071     bool hasDeletePermission( NumID userid, NumID docid );
00072 
00073     CoreError changeUserPermission( NumID userid, Permission permission, NumID adminid );
00074     CoreError changeFilePermission( NumID docid, Permission permission, NumID userid );
00075     CoreError filterSearchResults(QueryResult &queryResult);
00076     CoreError login( string username, string challenge, string response, UserProfile &user );
00077     CoreError addUser( const UserProfile &userProfile, string challenge, string password, NumID &userid );
00078     CoreError delUser( NumID userid );
00079     CoreError getUserProfile( NumID userid, UserProfile &userProfile );
00080     CoreError changeUserProfile( NumID userid, const UserProfile &userProfile );
00081     CoreError setPassword( NumID userid, string challenge, string oldPassword, string newPassword );
00082     CoreError clearPassword( NumID userid );
00083     CoreError listUsers( vector<NumID> &users );
00084     CoreError fileCreated( NumID userid, NumID docid, Permission permission );
00085 
00086 private:
00087     ODBCConnection odbc;
00088 
00089     string adminuser;
00090     string adminpass;
00091 };
00092 
00093 #endif

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18