Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_security_tasks.hpp
1/*
2##############################################################################
3# file: ms_security_tasks.hpp #
4# 'msparser' toolkit #
5# Encapsulates Mascot security 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: francoisr@matrixscience.com $ #
13# $Date: 2023-03-30 14:50:13 +0100 $ #
14# $Revision: 2f46535a8719ebb26a29bd04395eac8f0a9d9eeb | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19
20
21#if !defined(ms_security_tasks_INCLUDED_)
22#define ms_security_tasks_INCLUDED_
23
24
25// Includes from the standard template library
26#include <string>
27#include <map>
28#include <time.h>
29#include <vector>
30
31namespace matrix_science {
32
38
50 class MS_MASCOTRESFILE_API ms_security_tasks: public ms_errors
51 {
52 public:
54
63 enum TASKID
64 {
65 SECTASK_ALLOWPMF = 1,
66 SECTASK_ALLOWMSMS = 2,
67 SECTASK_ALLOWMSMSNOENZYME = 3,
68 SECTASK_ALLOWPMFNOENZYME = 4,
69 SECTASK_MAXCONCURRENTSEARCHES = 5,
70 SECTASK_MAXJOBPRIORITY = 6,
71 SECTASK_MAXQUERIES = 7,
72 SECTASK_MAXEXECUTIONTIME = 8,
73 SECTASK_ALLFASTA = 9,
74 SECTASK_NAMEDFASTA = 10,
75 SECTASK_MAXVARMODS = 11,
76 SECTASK_MAXETVARMODS = 12,
77
78 SECTASK_SEESEARCHINGROUP = 13,
79 SECTASK_SEEALLSEARCHESWITHUSERID= 14,
80 SECTASK_SEEOLDSEARCHES = 15,
81 SECTASK_USEMSREVIEWEXE = 16,
82
83 SECTASK_VIEWCONFIGUSINGMSSTATUS = 17,
84 SECTASK_MODIFYOWNPROFILE = 18,
85
86 SECTASK_DAEMONCLIENT = 19,
87 SECTASK_DISTILLERCLIENT = 20,
88 SECTASK_ALLOWSPOOFOTHERUSER = 22,
89 SECTASK_INTEGRASYSTEMACCOUNT = 23,
90 SECTASK_BIOTOOLSBATCH = 24,
91 SECTASK_SPOOFNAMEDGROUPSONLY = 25,
92 SECTASK_DOWNLOAD_DISTILLER_XML = 26,
93 SECTASK_UPLOAD_DISTILLER_XML = 27,
94
95 SECTASK_ADMINPAGES = 30,
96 SECTASK_ACCESSDBSETUP = 31,
97 SECTASK_USEMSSTATUSEXE = 32,
98 SECTASK_MSSTATUSEXECLUSTER = 33,
99 SECTASK_MSSTATUSEXERETRYDB = 34,
100 SECTASK_KILLTASKINGROUP = 35,
101 SECTASK_KILLALLTASK = 36,
102 SECTASK_VIEWCONFIG = 37,
103 SECTASK_EDITCONFIG = 38,
104
105 SECTASK_MAXETACCESSIONS = 50,
106 SECTASK_MAXNOENZQUERIES = 51,
107 SECTASK_MAXFASTAFILES = 52,
108 SECTASK_DENYQUANT = 53,
109 SECTASK_DATAURLPROTOCOLS = 54,
110 SECTASK_DATAURLMAXSIZE = 55,
111
112 SECTASK_SEESEARCHINANYGROUP = 60,
113
114 MISECTASK_ACCESS =100,
115 MISECTASK_PROTEINAPPROVAL =101,
116 MISECTASK_ADDIMPORTFILTER =102,
117 MISECTASK_ADMIN =103,
118 MISECTASK_ADDCUSTOMREPORT =104,
119 MISECTASK_DELETECUSTOMREPORT =105,
120 MISECTASK_ADDEXCLUSIONFILE =106,
121 MISECTASK_DELETEEXCLUSIONFILE =107,
122 MISECTASK_SENDNOTIFICATION =108
123 };
124
127
130
131 // Copying constructor for c++ programs - don't document
133
135 ms_security_tasks(const char * filename);
136
137#ifndef SWIG
138 // Assignment operator for c++ programs - don't document
139 ms_security_tasks& operator=(const ms_security_tasks& right);
140#endif
142 bool loadFromFile(const char * filename);
143
145 bool saveToFile(const char * filename);
146
148 bool addTask(const ms_security_task & task);
149
151 bool removeTask(const int taskID);
152
154 void removeAllTasks();
155
157 bool isPermitted(const int taskID) const;
158
160 bool isPermitted_long(const int taskID, const long value) const;
161
163 bool isPermitted_double(const int taskID, const double value) const;
164
166 bool isPermitted_string(const int taskID, const std::string value) const;
167
169 bool isFastaPermitted(const std::string database) const;
170
172 int getNumberOfTasks() const;
173
175 ms_security_task getTask(const int num) const;
176
178 ms_security_task getTaskFromID(const int taskID) const;
179
181 bool isTaskExists(const int taskID) const;
182
184 bool updateTask(const ms_security_task & task);
185#ifndef SWIG
186 ms_security_tasks & operator+=(const ms_security_tasks & a);
187#endif
189 std::string getDiffsAsText(const ms_security_tasks & old);
190
191 // Don't document
192 void updateAllUsersTasks(const std::set<int> & allUsers);
193
194 private:
195 typedef std::map<int, ms_security_task> tasksSet;
196 tasksSet tasks_;
197
198 void copyFrom(const ms_security_tasks* src);
199 }; // end of security_group
201
202}
203
204#endif // !defined(ms_security_tasks_INCLUDED_)
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
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
TASKID
Definitions for TASKID.
Definition: ms_security_tasks.hpp:64