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

UserProfile.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 Ewald Snel
00010    @author Wouter de Vries
00011 */
00012 
00013 #ifndef __USERPROFILE_H
00014 #define __USERPROFILE_H
00015 
00016 #ifdef HAVE_CONFIG_H
00017 #include <config.h>
00018 #endif
00019 
00020 #include <string>
00021 
00022 #include <AbstractDocument.h>
00023 #include <Common.h>
00024 #include <Error.h>
00025 #include <HashUtils.h>
00026 #include <XMLWriter.h>
00027 
00028 
00029 using namespace std;
00030 
00035 class UserProfile : public AbstractDocument
00036 {
00037 public:
00041     UserProfile();
00042 
00048     bool hasPermission( string name ) const;
00049 
00055     void setPermission( string name, bool value );
00056 
00062     bool hasPermissions( const UserProfile &user ) const;
00063 
00067     string toXML() const;
00068 
00073     DocumentError fromXML( const string &str );
00074 
00080     DocumentError fromXML( const string &str, NumID userid );
00081 
00085     NumID getID() const;
00086 
00087 private:
00088     hash_map<string,bool,_hash_string> permissions;
00089     NumID userid;
00090 };
00091 
00092 #endif

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