Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_security_group.hpp
1/*
2##############################################################################
3# file: ms_security_group.hpp #
4# 'msparser' toolkit #
5# Encapsulates a mascot user as used in authentication #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2004 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotresfi $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2018-07-30 16:23:53 +0100 $ #
14# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19
20
21#if !defined(ms_users_group_INCLUDED_)
22#define ms_users_group_INCLUDED_
23
24
25// Includes from the standard template library
26#include <string>
27#include <set>
28#include <vector>
29#include <map>
30#include <time.h>
31
32namespace matrix_science {
38 class MS_MASCOTRESFILE_API ms_group
39 {
40
41 public:
43
47 {
48 GROUPID_GUESTS = 0x0001,
49 GROUPID_ADMINISTRATORS = 0x0002,
50 GROUPID_POWERUSERS = 0x0003,
51 GROUPID_DAEMONS = 0x0004,
52 GROUPID_INTEGRA_SYSTEM = 0x0005,
53 GROUPID_LAST = 0x0006
54 };
55
57 ms_group();
58
60 ms_group(const int groupID, const std::string groupName);
61
62 // Copying constructor for c++ programs - don't document
63 ms_group(const ms_group &src);
64
65#ifndef SWIG
66 // Assignment operator for c++ programs - don't document
67 ms_group & operator=(const ms_group & right);
68#endif
69 ~ms_group();
70
72 bool addUser(const int userID);
73
75 bool deleteUser(const int userID);
76
78 bool isUserInGroup(const int userID) const;
79
81 std::vector<int> getAllUserIDs(const void * const security = NULL, const int voidSortby = 1) const;
82
84 std::string getName() const;
85
87 void setName(const std::string newVal);
88
90 void addPermittedTask(const matrix_science::ms_security_task & task);
91
93 bool removePermittedTask(const int taskID);
94
96 matrix_science::ms_security_tasks getPermittedTasks() const;
97
99 void setPermittedTasks(matrix_science::ms_security_tasks& tasks);
100
102 int getID() const;
103
105 void setID(int newVal);
106
108 bool saveStringParam(const std::string name, const std::string param);
109
110#ifndef SWIG
112 bool getStringParam(const std::string name, std::string & param) const;
113#endif
114
116 std::string getStringParam(const std::string name) const;
117
119 bool clearParam(const std::string name);
120
121#ifndef SWIG
122#ifndef DOXYGEN_SHOULD_SKIP_THIS
123 typedef std::map<std::string, std::string> customParams_t;
124 customParams_t getAllCustomParams() const { return params_; }
125#endif
126#endif
127
128 private:
129 int groupID_;
130 typedef std::set<int> users_t;
131 ms_security_tasks tasks_;
132 std::string groupName_;
133 users_t users_;
134 customParams_t params_;
135
136 void copyFrom(const ms_group * src);
137 void updateUsersArrayTasks();
138 }; // end of security_group
140}
141#endif // !defined(ms_users_group_INCLUDED_)
This class will normally only be used by Mascot Security Administration applications.
Definition: ms_security_group.hpp:39
systemids
Definitions for predefined groups.
Definition: ms_security_group.hpp:47
Each group has permission to do one or more tasks. This class defines an individual task.
Definition: ms_security_task.hpp:51
Each group has permission to do one or more tasks. This class defines a collection of tasks.
Definition: ms_security_tasks.hpp:51