00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(ms_users_group_INCLUDED_)
00022 #define ms_users_group_INCLUDED_
00023
00024
00025
00026 #include <string>
00027 #include <set>
00028 #include <vector>
00029 #include <map>
00030 #include <time.h>
00031
00032 namespace matrix_science {
00037
00038 class MS_MASCOTRESFILE_API ms_group
00039 {
00040
00041 public:
00043
00046 enum systemids
00047 {
00048 GROUPID_GUESTS = 0x0001,
00049 GROUPID_ADMINISTRATORS = 0x0002,
00050 GROUPID_POWERUSERS = 0x0003,
00051 GROUPID_DAEMONS = 0x0004,
00052 GROUPID_INTEGRA_SYSTEM = 0x0005,
00053 GROUPID_LAST = 0x0006
00054 };
00055
00057 ms_group();
00058
00060 ms_group(const int groupID, const std::string groupName);
00061
00062
00063 ms_group(const ms_group &src);
00064
00065 #ifndef SWIG
00066
00067 ms_group & operator=(const ms_group & right);
00068 #endif
00069 ~ms_group();
00070
00072 bool addUser(const int userID);
00073
00075 bool deleteUser(const int userID);
00076
00078 bool isUserInGroup(const int userID) const;
00079
00081 std::vector<int> getAllUserIDs(const void * const security = NULL, const int voidSortby = 1) const;
00082
00084 std::string getName() const;
00085
00087 void setName(const std::string newVal);
00088
00090 void addPermittedTask(const matrix_science::ms_security_task & task);
00091
00093 bool removePermittedTask(const int taskID);
00094
00096 matrix_science::ms_security_tasks getPermittedTasks() const;
00097
00099 void setPermittedTasks(matrix_science::ms_security_tasks& tasks);
00100
00102 int getID() const;
00103
00105 void setID(int newVal);
00106
00108 bool saveStringParam(const std::string name, const std::string param);
00109
00110 #ifndef SWIG
00111
00112 bool getStringParam(const std::string name, std::string & param) const;
00113 #endif
00114
00116 std::string getStringParam(const std::string name) const;
00117
00119 bool clearParam(const std::string name);
00120
00121 #ifndef SWIG
00122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00123 typedef std::map<std::string, std::string> customParams_t;
00124 customParams_t getAllCustomParams() const { return params_; }
00125 #endif
00126 #endif
00127
00128 private:
00129 int groupID_;
00130 typedef std::set<int> users_t;
00131 ms_security_tasks tasks_;
00132 std::string groupName_;
00133 users_t users_;
00134 customParams_t params_;
00135
00136 void copyFrom(const ms_group * src);
00137 void updateUsersArrayTasks();
00138 };
00140 }
00141 #endif // !defined(ms_users_group_INCLUDED_)