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 $ #
00013 #       $Date: 2015/12/15 10:09:21 $ #
00014 #   $Revision: 1.33 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 
00020 
00021 #if !defined(ms_security_tasks_INCLUDED_)
00022 #define ms_security_tasks_INCLUDED_
00023 
00024 #ifdef _WIN32
00025 #pragma warning(disable:4251)   // Don't want all classes to be exported
00026 #pragma warning(disable:4786)   // Debug symbols too long
00027 #   ifndef _MATRIX_USE_STATIC_LIB
00028 #       ifdef MS_MASCOTRESFILE_EXPORTS
00029 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00030 #       else
00031 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00032 #       endif
00033 #   else
00034 #       define MS_MASCOTRESFILE_API
00035 #   endif
00036 #else
00037 #   define MS_MASCOTRESFILE_API
00038 #endif
00039 
00040 // Includes from the standard template library
00041 #include <string>
00042 #include <map>
00043 #include <time.h>
00044 #include <vector>
00045 
00046 namespace matrix_science {
00047 
00052 
00053 
00065     class MS_MASCOTRESFILE_API ms_security_tasks: public ms_errors
00066     {
00067     public:
00069 
00078         enum TASKID
00079         {
00080             SECTASK_ALLOWPMF                =  1, 
00081             SECTASK_ALLOWMSMS               =  2, 
00082             SECTASK_ALLOWMSMSNOENZYME       =  3, 
00083             SECTASK_ALLOWPMFNOENZYME        =  4, 
00084             SECTASK_MAXCONCURRENTSEARCHES   =  5, 
00085             SECTASK_MAXJOBPRIORITY          =  6, 
00086             SECTASK_MAXQUERIES              =  7, 
00087             SECTASK_MAXEXECUTIONTIME        =  8, 
00088             SECTASK_ALLFASTA                =  9, 
00089             SECTASK_NAMEDFASTA              = 10, 
00090             SECTASK_MAXVARMODS              = 11, 
00091             SECTASK_MAXETVARMODS            = 12, 
00092 
00093             SECTASK_SEESEARCHINGROUP        = 13, 
00094             SECTASK_SEEALLSEARCHESWITHUSERID= 14, 
00095             SECTASK_SEEOLDSEARCHES          = 15, 
00096             SECTASK_USEMSREVIEWEXE          = 16, 
00097 
00098             SECTASK_VIEWCONFIGUSINGMSSTATUS = 17, 
00099             SECTASK_MODIFYOWNPROFILE        = 18, 
00100 
00101             SECTASK_DAEMONCLIENT            = 19, 
00102             SECTASK_DISTILLERCLIENT         = 20, 
00103             SECTASK_ALLOWSPOOFOTHERUSER     = 22, 
00104             SECTASK_INTEGRASYSTEMACCOUNT    = 23, 
00105             SECTASK_BIOTOOLSBATCH           = 24, 
00106             SECTASK_SPOOFNAMEDGROUPSONLY    = 25, 
00107             SECTASK_DOWNLOAD_DISTILLER_XML  = 26, 
00108             SECTASK_UPLOAD_DISTILLER_XML    = 27, 
00109 
00110             SECTASK_ADMINPAGES              = 30, 
00111             SECTASK_ACCESSDBSETUP           = 31, 
00112             SECTASK_USEMSSTATUSEXE          = 32, 
00113             SECTASK_MSSTATUSEXECLUSTER      = 33, 
00114             SECTASK_MSSTATUSEXERETRYDB      = 34, 
00115             SECTASK_KILLTASKINGROUP         = 35, 
00116             SECTASK_KILLALLTASK             = 36, 
00117             SECTASK_VIEWCONFIG              = 37, 
00118             SECTASK_EDITCONFIG              = 38, 
00119 
00120             SECTASK_MAXETACCESSIONS         = 50, 
00121             SECTASK_MAXNOENZQUERIES         = 51, 
00122             SECTASK_MAXFASTAFILES           = 52, 
00123             SECTASK_DENYQUANT               = 53, 
00124             SECTASK_DATAURLPROTOCOLS        = 54, 
00125             SECTASK_DATAURLMAXSIZE          = 55, 
00126 
00127             SECTASK_SEESEARCHINANYGROUP     = 60, 
00128 
00129             MISECTASK_ACCESS                =100, 
00130             MISECTASK_PROTEINAPPROVAL       =101, 
00131             MISECTASK_ADDIMPORTFILTER       =102, 
00132             MISECTASK_ADMIN                 =103, 
00133             MISECTASK_ADDCUSTOMREPORT       =104, 
00134             MISECTASK_DELETECUSTOMREPORT    =105, 
00135             MISECTASK_ADDEXCLUSIONFILE      =106, 
00136             MISECTASK_DELETEEXCLUSIONFILE   =107, 
00137             MISECTASK_SENDNOTIFICATION      =108  
00138         };
00139 
00141         ms_security_tasks();
00142 
00144         ~ms_security_tasks();
00145 
00146         // Copying constructor for c++ programs - don't document
00147         ms_security_tasks(const ms_security_tasks& src);
00148 
00150         ms_security_tasks(const char * filename);
00151 
00152 #ifndef SWIG
00153         // Assignment operator for c++ programs - don't document
00154         ms_security_tasks& operator=(const ms_security_tasks& right);
00155 #endif
00156 
00157         bool loadFromFile(const char * filename);
00158 
00160         bool saveToFile(const char * filename);
00161 
00163         bool addTask(const ms_security_task & task);
00164 
00166         bool removeTask(const int taskID);
00167 
00169         void removeAllTasks();
00170 
00172         bool isPermitted(const int taskID) const;
00173 
00175         bool isPermitted_long(const int taskID, const long value) const;
00176 
00178         bool isPermitted_double(const int taskID, const double value) const;
00179 
00181         bool isPermitted_string(const int taskID, const std::string value) const;
00182 
00184         bool isFastaPermitted(const std::string database) const;
00185 
00187         int getNumberOfTasks() const;
00188 
00190         ms_security_task getTask(const int num) const;
00191 
00193         ms_security_task getTaskFromID(const int taskID) const;
00194 
00196         bool isTaskExists(const int taskID) const;
00197 
00199         bool updateTask(const ms_security_task & task);
00200 
00201         ms_security_tasks & operator+=(const ms_security_tasks & a);
00202 
00204         std::string getDiffsAsText(const ms_security_tasks & old);
00205 
00206         // Don't document
00207         void updateAllUsersTasks(const std::set<int> & allUsers);
00208 
00209     private:
00210         typedef std::map<int, ms_security_task> tasksSet;
00211         tasksSet    tasks_;
00212 
00213         void copyFrom(const ms_security_tasks* src);
00214     }; // end of security_group
00216 
00217 }
00218 
00219 #endif // !defined(ms_security_tasks_INCLUDED_)
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51