00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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