Matrix Science header

ms_security_group.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_security_group.hpp                                                #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates a mascot user as used in authentication                       #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2004 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotresfi $ #
00012 #     $Author: villek@matrixscience.com $ #
00013 #       $Date: 2018-07-30 16:23:53 +0100 $ #
00014 #   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 
00020 
00021 #if !defined(ms_users_group_INCLUDED_)
00022 #define ms_users_group_INCLUDED_
00023 
00024 
00025 // Includes from the standard template library
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         // Copying constructor for c++ programs - don't document
00063         ms_group(const ms_group &src);
00064 
00065 #ifndef SWIG
00066         // Assignment operator for c++ programs - don't document
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     }; // end of security_group 
00140 }
00141 #endif // !defined(ms_users_group_INCLUDED_)

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:30