Matrix Science header

ms_security_tasks.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_security_tasks.hpp                                                #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates Mascot security 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: francoisr@matrixscience.com $ #
00013 #       $Date: 2020-01-09 13:44:20 +0000 $ #
00014 #   $Revision: 8f2eed45ceb9f62bfae7c1eaa2c043cac1d9f802 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 
00020 
00021 #if !defined(ms_security_tasks_INCLUDED_)
00022 #define ms_security_tasks_INCLUDED_
00023 
00024 
00025 // Includes from the standard template library
00026 #include <string>
00027 #include <map>
00028 #include <time.h>
00029 #include <vector>
00030 
00031 namespace matrix_science {
00032 
00037 
00038 
00050     class MS_MASCOTRESFILE_API ms_security_tasks: public ms_errors
00051     {
00052     public:
00054 
00063         enum TASKID
00064         {
00065             SECTASK_ALLOWPMF                =  1, 
00066             SECTASK_ALLOWMSMS               =  2, 
00067             SECTASK_ALLOWMSMSNOENZYME       =  3, 
00068             SECTASK_ALLOWPMFNOENZYME        =  4, 
00069             SECTASK_MAXCONCURRENTSEARCHES   =  5, 
00070             SECTASK_MAXJOBPRIORITY          =  6, 
00071             SECTASK_MAXQUERIES              =  7, 
00072             SECTASK_MAXEXECUTIONTIME        =  8, 
00073             SECTASK_ALLFASTA                =  9, 
00074             SECTASK_NAMEDFASTA              = 10, 
00075             SECTASK_MAXVARMODS              = 11, 
00076             SECTASK_MAXETVARMODS            = 12, 
00077 
00078             SECTASK_SEESEARCHINGROUP        = 13, 
00079             SECTASK_SEEALLSEARCHESWITHUSERID= 14, 
00080             SECTASK_SEEOLDSEARCHES          = 15, 
00081             SECTASK_USEMSREVIEWEXE          = 16, 
00082 
00083             SECTASK_VIEWCONFIGUSINGMSSTATUS = 17, 
00084             SECTASK_MODIFYOWNPROFILE        = 18, 
00085 
00086             SECTASK_DAEMONCLIENT            = 19, 
00087             SECTASK_DISTILLERCLIENT         = 20, 
00088             SECTASK_ALLOWSPOOFOTHERUSER     = 22, 
00089             SECTASK_INTEGRASYSTEMACCOUNT    = 23, 
00090             SECTASK_BIOTOOLSBATCH           = 24, 
00091             SECTASK_SPOOFNAMEDGROUPSONLY    = 25, 
00092             SECTASK_DOWNLOAD_DISTILLER_XML  = 26, 
00093             SECTASK_UPLOAD_DISTILLER_XML    = 27, 
00094 
00095             SECTASK_ADMINPAGES              = 30, 
00096             SECTASK_ACCESSDBSETUP           = 31, 
00097             SECTASK_USEMSSTATUSEXE          = 32, 
00098             SECTASK_MSSTATUSEXECLUSTER      = 33, 
00099             SECTASK_MSSTATUSEXERETRYDB      = 34, 
00100             SECTASK_KILLTASKINGROUP         = 35, 
00101             SECTASK_KILLALLTASK             = 36, 
00102             SECTASK_VIEWCONFIG              = 37, 
00103             SECTASK_EDITCONFIG              = 38, 
00104 
00105             SECTASK_MAXETACCESSIONS         = 50, 
00106             SECTASK_MAXNOENZQUERIES         = 51, 
00107             SECTASK_MAXFASTAFILES           = 52, 
00108             SECTASK_DENYQUANT               = 53, 
00109             SECTASK_DATAURLPROTOCOLS        = 54, 
00110             SECTASK_DATAURLMAXSIZE          = 55, 
00111 
00112             SECTASK_SEESEARCHINANYGROUP     = 60, 
00113 
00114             MISECTASK_ACCESS                =100, 
00115             MISECTASK_PROTEINAPPROVAL       =101, 
00116             MISECTASK_ADDIMPORTFILTER       =102, 
00117             MISECTASK_ADMIN                 =103, 
00118             MISECTASK_ADDCUSTOMREPORT       =104, 
00119             MISECTASK_DELETECUSTOMREPORT    =105, 
00120             MISECTASK_ADDEXCLUSIONFILE      =106, 
00121             MISECTASK_DELETEEXCLUSIONFILE   =107, 
00122             MISECTASK_SENDNOTIFICATION      =108  
00123         };
00124 
00126         ms_security_tasks();
00127 
00129         ~ms_security_tasks();
00130 
00131         // Copying constructor for c++ programs - don't document
00132         ms_security_tasks(const ms_security_tasks& src);
00133 
00135         ms_security_tasks(const char * filename);
00136 
00137 #ifndef SWIG
00138         // Assignment operator for c++ programs - don't document
00139         ms_security_tasks& operator=(const ms_security_tasks& right);
00140 #endif
00141 
00142         bool loadFromFile(const char * filename);
00143 
00145         bool saveToFile(const char * filename);
00146 
00148         bool addTask(const ms_security_task & task);
00149 
00151         bool removeTask(const int taskID);
00152 
00154         void removeAllTasks();
00155 
00157         bool isPermitted(const int taskID) const;
00158 
00160         bool isPermitted_long(const int taskID, const long value) const;
00161 
00163         bool isPermitted_double(const int taskID, const double value) const;
00164 
00166         bool isPermitted_string(const int taskID, const std::string value) const;
00167 
00169         bool isFastaPermitted(const std::string database) const;
00170 
00172         int getNumberOfTasks() const;
00173 
00175         ms_security_task getTask(const int num) const;
00176 
00178         ms_security_task getTaskFromID(const int taskID) const;
00179 
00181         bool isTaskExists(const int taskID) const;
00182 
00184         bool updateTask(const ms_security_task & task);
00185 #ifndef SWIG
00186         ms_security_tasks & operator+=(const ms_security_tasks & a);
00187 #endif
00188 
00189         std::string getDiffsAsText(const ms_security_tasks & old);
00190 
00191         // Don't document
00192         void updateAllUsersTasks(const std::set<int> & allUsers);
00193 
00194     private:
00195         typedef std::map<int, ms_security_task> tasksSet;
00196         tasksSet    tasks_;
00197 
00198         void copyFrom(const ms_security_tasks* src);
00199     }; // end of security_group
00201 
00202 }
00203 
00204 #endif // !defined(ms_security_tasks_INCLUDED_)

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