Matrix Science header
Public Types | Public Member Functions

ms_security_tasks Class Reference
[Mascot security and authentication module]

Each group has permission to do one or more tasks. This class defines a collection of tasks. More...

#include <ms_security_tasks.hpp>

Inheritance diagram for ms_security_tasks:
Inheritance graph
[legend]
Collaboration diagram for ms_security_tasks:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TASKID {
  SECTASK_ALLOWPMF = 1,
  SECTASK_ALLOWMSMS = 2,
  SECTASK_ALLOWMSMSNOENZYME = 3,
  SECTASK_ALLOWPMFNOENZYME = 4,
  SECTASK_MAXCONCURRENTSEARCHES = 5,
  SECTASK_MAXJOBPRIORITY = 6,
  SECTASK_MAXQUERIES = 7,
  SECTASK_MAXEXECUTIONTIME = 8,
  SECTASK_ALLFASTA = 9,
  SECTASK_NAMEDFASTA = 10,
  SECTASK_MAXVARMODS = 11,
  SECTASK_MAXETVARMODS = 12,
  SECTASK_SEESEARCHINGROUP = 13,
  SECTASK_SEEALLSEARCHESWITHUSERID = 14,
  SECTASK_SEEOLDSEARCHES = 15,
  SECTASK_USEMSREVIEWEXE = 16,
  SECTASK_VIEWCONFIGUSINGMSSTATUS = 17,
  SECTASK_MODIFYOWNPROFILE = 18,
  SECTASK_DAEMONCLIENT = 19,
  SECTASK_DISTILLERCLIENT = 20,
  SECTASK_ALLOWSPOOFOTHERUSER = 22,
  SECTASK_INTEGRASYSTEMACCOUNT = 23,
  SECTASK_BIOTOOLSBATCH = 24,
  SECTASK_SPOOFNAMEDGROUPSONLY = 25,
  SECTASK_DOWNLOAD_DISTILLER_XML = 26,
  SECTASK_UPLOAD_DISTILLER_XML = 27,
  SECTASK_ADMINPAGES = 30,
  SECTASK_ACCESSDBSETUP = 31,
  SECTASK_USEMSSTATUSEXE = 32,
  SECTASK_MSSTATUSEXECLUSTER = 33,
  SECTASK_MSSTATUSEXERETRYDB = 34,
  SECTASK_KILLTASKINGROUP = 35,
  SECTASK_KILLALLTASK = 36,
  SECTASK_VIEWCONFIG = 37,
  SECTASK_EDITCONFIG = 38,
  SECTASK_MAXETACCESSIONS = 50,
  SECTASK_MAXNOENZQUERIES = 51,
  SECTASK_MAXFASTAFILES = 52,
  SECTASK_DENYQUANT = 53,
  SECTASK_DATAURLPROTOCOLS = 54,
  SECTASK_DATAURLMAXSIZE = 55,
  SECTASK_SEESEARCHINANYGROUP = 60,
  MISECTASK_ACCESS = 100,
  MISECTASK_PROTEINAPPROVAL = 101,
  MISECTASK_ADDIMPORTFILTER = 102,
  MISECTASK_ADMIN = 103,
  MISECTASK_ADDCUSTOMREPORT = 104,
  MISECTASK_DELETECUSTOMREPORT = 105,
  MISECTASK_ADDEXCLUSIONFILE = 106,
  MISECTASK_DELETEEXCLUSIONFILE = 107,
  MISECTASK_SENDNOTIFICATION = 108
}
 

Definitions for TASKID.

More...

Public Member Functions

 ms_security_tasks ()
 Create an empty list of tasks.
 ms_security_tasks (const char *filename)
 Load the list of tasks from file.
 ~ms_security_tasks ()
 Destructor of the class.
bool addTask (const ms_security_task &task)
 Add a task to the list.
void appendErrors (const ms_errors &src)
 Copies all errors from another instance and appends them at the end of own list.
void clearAllErrors ()
 Remove all errors from the current list of errors.
void copyFrom (const ms_errors *right)
 Use this member to make a copy of another instance.
std::string getDiffsAsText (const ms_security_tasks &old)
 Returns differences between the two task lists as text.
const ms_errsgetErrorHandler () const
 Retrive the error object using this function to get access to all errors and error parameters.
int getLastError () const
 Return the error description of the last error that occurred.
std::string getLastErrorString () const
 Return the error description of the last error that occurred.
int getNumberOfTasks () const
 Returns the number of tasks in the collection.
ms_security_task getTask (const int num) const
 Returns a particular task.
ms_security_task getTaskFromID (const int taskID) const
 Returns a particular task.
bool isFastaPermitted (const std::string database) const
 See if a particular fasta file can be accessed.
bool isPermitted (const int taskID) const
 See if the task is permitted.
bool isPermitted_double (const int taskID, const double value) const
 See if the value is in the floating point parameter list.
bool isPermitted_long (const int taskID, const long value) const
 See if the value is in the long integer parameter list.
bool isPermitted_string (const int taskID, const std::string value) const
 See if the value is in the string parameter list.
bool isTaskExists (const int taskID) const
 Returns true if a task with this ID exists.
bool isValid () const
 Call this function to determine if there have been any errors.
bool loadFromFile (const char *filename)
 Load definitions either from security_tasks.xml or from a group file.
void removeAllTasks ()
 Remove all tasks from the list.
bool removeTask (const int taskID)
 Remove a task from the list.
bool saveToFile (const char *filename)
 Save definitions either to the security_tasks.xml file or to a group file.
bool updateTask (const ms_security_task &task)
 Updates a task in the list with new parameters.

Detailed Description

Each group has permission to do one or more tasks. This class defines a collection of tasks.

There is currently no programmatic interface for saving task information, since this should normally only be done by developers.

Tasks are loaded from the file security_tasks.xml.

Parameters, for example, the maximum number of queries for a group, or the databases that can be used by a group are not saved in security_tasks.xml, but are saved as part of the group file. However, the type of the parameter is saved in security_tasks.xml.


Member Enumeration Documentation

enum TASKID

Definitions for TASKID.

See Using enumerated values and static const ints in Perl, Java, Python and C#.

Each task has one or more parameters associated with it. For example, "Access to administration pages" would have a boolean value. Other tasks such as "Maximum execution time" need a single number to determine the limit. security_tasks.xml has further information about each task.

Enumerator:
SECTASK_ALLOWPMF 

SEARCH: Allow PMF searches.

SECTASK_ALLOWMSMS 

SEARCH: Allow MS-MS (and SQ) searches.

SECTASK_ALLOWMSMSNOENZYME 

SEARCH: Allow no-enzyme MSMS searche.

SECTASK_ALLOWPMFNOENZYME 

SEARCH: Allow no-enzyme PMF searches.

SECTASK_MAXCONCURRENTSEARCHES 

SEARCH: Maximum number of concurrent searches per user.

SECTASK_MAXJOBPRIORITY 

SEARCH: Maximum mascot search job priority.

SECTASK_MAXQUERIES 

SEARCH: Maximum number of queries per search.

SECTASK_MAXEXECUTIONTIME 

SEARCH: Maximum execution time.

SECTASK_ALLFASTA 

SEARCH: Allow all fasta databases to be searched.

SECTASK_NAMEDFASTA 

SEARCH: Special fasta databases that override the default setting.

SECTASK_MAXVARMODS 

SEARCH: Maximum number of variable modifications allowed for a standard search.

SECTASK_MAXETVARMODS 

SEARCH: Maximum number of variable modifications allowed in an error tolerant search.

SECTASK_SEESEARCHINGROUP 

VIEW: See search results from other people in your own group.

SECTASK_SEEALLSEARCHESWITHUSERID 

VIEW: See all search results with a USERID.

SECTASK_SEEOLDSEARCHES 

VIEW: See search results without USERID field.

SECTASK_USEMSREVIEWEXE 

VIEW: Allow user to view the search log.

SECTASK_VIEWCONFIGUSINGMSSTATUS 

GENERAL: View config files using ms-status.

SECTASK_MODIFYOWNPROFILE 

GENERAL: Allow user to modify their own profile.

SECTASK_DAEMONCLIENT 

CLIENT: Mascot Daemon is allowed to submit searches.

SECTASK_DISTILLERCLIENT 

CLIENT: Mascot Distiller is allowed to submit searches.

SECTASK_ALLOWSPOOFOTHERUSER 

CLIENT: For Mascot Daemon, allow spoofing of another user.

SECTASK_INTEGRASYSTEMACCOUNT 
Deprecated:
CLIENT: Integra system account.
SECTASK_BIOTOOLSBATCH 

CLIENT: Bruker BioTools batch searches.

SECTASK_SPOOFNAMEDGROUPSONLY 

CLIENT: For Mascot Daemon, restrict spoofing to the named group(s).

SECTASK_DOWNLOAD_DISTILLER_XML 

CLIENT: Client is allowed to download Distiller XML files.

SECTASK_UPLOAD_DISTILLER_XML 

CLIENT: Client is allowed to upload Distiller XML files.

SECTASK_ADMINPAGES 

ADMIN: Use the security administration utility.

SECTASK_ACCESSDBSETUP 

ADMIN: Access to the Database Maintenance application.

SECTASK_USEMSSTATUSEXE 

ADMIN: Allow use of Database Status application.

SECTASK_MSSTATUSEXECLUSTER 

ADMIN: Allow user to see cluster pages in ms-status.exe.

SECTASK_MSSTATUSEXERETRYDB 

ADMIN: Allow user to retry a failed database or recompress files using ms-status.exe.

SECTASK_KILLTASKINGROUP 

ADMIN: Kill / pause / change priority of searches from own group.

SECTASK_KILLALLTASK 

ADMIN: Kill / pause / change priority of searches from other groups.

SECTASK_VIEWCONFIG 

ADMIN: Access to the configuration editor to view configuration files.

SECTASK_EDITCONFIG 

ADMIN: Access to the configuration editor to edit configuration files.

SECTASK_MAXETACCESSIONS 

SEARCH: Maximum number of accessions allowed in an old style error tolerant search.

SECTASK_MAXNOENZQUERIES 

SEARCH: Maximum number of queries for a no enzyme search. If not specified, SECTASK_MAXQUERIES will be used.

SECTASK_MAXFASTAFILES 

SEARCH: Maximum number of fasta files in a single search.

SECTASK_DENYQUANT 

SEARCH: Prevent the use of quantitation methods in a search.

SECTASK_DATAURLPROTOCOLS 

SEARCH: Allow submitting searches with DATAURL parameter.

SECTASK_DATAURLMAXSIZE 

SEARCH: Maximum number of bytes to download for DATAURL.

SECTASK_SEESEARCHINANYGROUP 

VIEW: See search results from any user in any group you belong to.

MISECTASK_ACCESS 

INSIGHT: Access to Mascot Insight.

MISECTASK_PROTEINAPPROVAL 

INSIGHT: Protein approval in Mascot Insight.

MISECTASK_ADDIMPORTFILTER 

INSIGHT: Add import assignment filter.

MISECTASK_ADMIN 

INSIGHT: Mascot Insight administration functions.

MISECTASK_ADDCUSTOMREPORT 

INSIGHT: Add custom report to Mascot Insight.

MISECTASK_DELETECUSTOMREPORT 

INSIGHT: Delete custom report Mascot Insight.

MISECTASK_ADDEXCLUSIONFILE 

INSIGHT: Add BlastCluster exclusion file.

MISECTASK_DELETEEXCLUSIONFILE 

INSIGHT: Delete BlastCluster exclusion file.

MISECTASK_SENDNOTIFICATION 

INSIGHT: Send notification.


Constructor & Destructor Documentation

Create an empty list of tasks.

Default constructor does nothing. Need to call loadFromFile() or addTask() to assign tasks to the list.

Destructor of the class.

The destructor is never called directly.


Member Function Documentation

bool addTask ( const ms_security_task task )

Add a task to the list.

If there is already a task with this ID, then the two will be 'combined'. For example, assume that the task SECTASK_ALLOWNAMEDFASTA is already in the list with NCBInr as a parameter. If this function is called with the same task, but MSDB as a parameter, then the resulting task will have MSDB and NCBInr as parameters.

Similarly, if the task SECTASK_MAXQUERIES is already in the list with a value of 300, and a new task is added with a value of 1000, then the value 1000 will be used. For the types ms_security_task::TYPE_EQ_LONG, ms_security_task::TYPE_EQ_DOUBLE and ms_security_task::TYPE_EQ_STRING, the parameter for the new task being added will replace the existing task parameter.

Parameters:
taskis the new task to be added to the list.
Returns:
True if the function succeeds. The function should not normally fail.
void appendErrors ( const ms_errors src ) [inherited]

Copies all errors from another instance and appends them at the end of own list.

Parameters:
srcThe object to copy the errors across from. See Maintaining object references: two rules of thumb.
void clearAllErrors (  ) [inherited]

Remove all errors from the current list of errors.

The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.

All messages are accumulated into a list in this object, until clearAllErrors() is called.

See Error Handling.

See also:
isValid(), getLastError(), getLastErrorString(), getErrorHandler()
Examples:
common_error.cpp, resfile_error.cpp, and resfile_summary.cpp.
void copyFrom ( const ms_errors right ) [inherited]

Use this member to make a copy of another instance.

Parameters:
rightis the source to initialise from
std::string getDiffsAsText ( const ms_security_tasks old )

Returns differences between the two task lists as text.

Primarily used for logging.

Parameters:
oldms_security_tasks object to diff
Returns:
all differences as a string
const ms_errs * getErrorHandler (  ) const [inherited]

Retrive the error object using this function to get access to all errors and error parameters.

See Error Handling.

Returns:
Constant pointer to the error handler
See also:
isValid(), getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples:
common_error.cpp, and http_helper_getstring.cpp.
int getLastError (  ) const [inherited]

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

See Error Handling.

See also:
isValid(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Returns:
the error number of the last error, or 0 if there have been no errors.

Reimplemented in ms_mascotresfile.

std::string getLastErrorString (  ) const [inherited]

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

Returns:
Most recent error, warning, information or debug message

See Error Handling.

See also:
isValid(), getLastError(), clearAllErrors(), getErrorHandler()

Reimplemented in ms_mascotresfile.

Examples:
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, and tools_aahelper.cpp.
int getNumberOfTasks (  ) const

Returns the number of tasks in the collection.

Use this value when trying to retrieve all tasks using getTask().

Returns:
number of tasks
ms_security_task getTask ( const int  num ) const

Returns a particular task.

Parameters:
numshould be in the range 0.. getNumberOfTasks() -1
Returns:
an ms_security_task object. If there was an error, the id for this security object will be -1.
ms_security_task getTaskFromID ( const int  taskID ) const

Returns a particular task.

Find a task in the collection given its ID.

Parameters:
taskIDshould be a valid taskID.
Returns:
an ms_security_task object. If there was an error, the id for this security object will be -1.
bool isFastaPermitted ( const std::string  database ) const

See if a particular fasta file can be accessed.

Check if a user has rights to search against a particular database This is a special case because SECTASK_NAMEDFASTA is the only 'negative' task (and only if SECTASK_ALLFASTA is set), so this specific call makes end user programs simpler.

Parameters:
databaseis the database name -- for example MSDB.
Returns:
True if the user has rights to search this database.
bool isPermitted ( const int  taskID ) const

See if the task is permitted.

For example, this could called by an application to determine if a user has rights to access administration screens.

This function should only be called if the parameter type of taskID is ms_security_task::TYPE_BOOL.

Parameters:
taskIDThe taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration -- for example, matrix_science::ms_security_tasks::SECTASK_ADMINPAGES.
Returns:
true if the parameter type is ms_security_task::TYPE_BOOL, and the specified task in the list of tasks otherwise it will return false.
bool isPermitted_double ( const int  taskID,
const double  value 
) const

See if the value is in the floating point parameter list.

See also:
ms_security_task::isPermitted_double()
Parameters:
taskIDThe taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration -- for example, matrix_science::ms_security_tasks::SECTASK_MAXQUERIES.
valueis the value for comparison.
Returns:
True if the tasks is permitted.
bool isPermitted_long ( const int  taskID,
const long  value 
) const

See if the value is in the long integer parameter list.

For example, this could called by an application to determine if a user has rights to run a search with 1000 spectra.

See also:
ms_security_task::isPermitted_long()
Parameters:
taskIDThe taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration -- for example, matrix_science::ms_security_tasks::SECTASK_MAXQUERIES.
valueis the value for comparison.
Returns:
True if the tasks is permitted.
bool isPermitted_string ( const int  taskID,
const std::string  value 
) const

See if the value is in the string parameter list.

For example, this could called by an application to determine if a user has rights to run a search against the MSDB database.

See also:
isFastaPermitted(), ms_security_task::isPermitted_string()
Parameters:
taskIDThe taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration -- for example, matrix_science::ms_security_tasks::SECTASK_NAMEDFASTA.
valueIs the value for comparison.
Returns:
True if the tasks is permitted.
bool isTaskExists ( const int  taskID ) const

Returns true if a task with this ID exists.

Parameters:
taskIDTask ID to check.
Returns:
true if a task with this ID exists; false otherwise.
bool isValid (  ) const [inherited]

Call this function to determine if there have been any errors.

This will return true unless there have been any fatal errors.

See Error Handling.

Returns:
True if no fatal error occured
See also:
getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples:
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, peptide_list.cpp, resfile_summary.cpp, and tools_aahelper.cpp.
void removeAllTasks (  )

Remove all tasks from the list.

The result will then be an empty list.

bool removeTask ( const int  taskID )

Remove a task from the list.

Parameters:
taskIDShould be a valid task ID.
Returns:
True if the task was in the list and was deleted.
bool updateTask ( const ms_security_task task )

Updates a task in the list with new parameters.

Parameters:
taskReplace the definition for a task in the list with this.
Returns:
True if the task was already in the list.

The documentation for this class was generated from the following files:

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