Each group has permission to do one or more tasks. This class defines a collection of tasks. More...
#include <ms_security_tasks.hpp>
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_errs * | getErrorHandler () 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. | |
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
.
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 |
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 |
|
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 |
SECTASK_MSSTATUSEXERETRYDB | ADMIN: Allow user to retry a failed database or recompress files using |
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 |
|
MISECTASK_PROTEINAPPROVAL |
|
MISECTASK_ADDIMPORTFILTER |
|
MISECTASK_ADMIN |
|
MISECTASK_ADDCUSTOMREPORT |
|
MISECTASK_DELETECUSTOMREPORT |
|
MISECTASK_ADDEXCLUSIONFILE |
|
MISECTASK_DELETEEXCLUSIONFILE |
|
MISECTASK_SENDNOTIFICATION |
|
Create an empty list of tasks.
Default constructor does nothing. Need to call loadFromFile() or addTask() to assign tasks to the list.
~ms_security_tasks | ( | ) |
Destructor of the class.
The destructor is never called directly.
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.
task | is the new task to be added to the list. |
|
inherited |
Copies all errors from another instance and appends them at the end of own list.
src | The object to copy the errors across from. See Maintaining object references: two rules of thumb. |
|
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.
|
inherited |
Use this member to make a copy of another instance.
right | is 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.
old | ms_security_tasks object to diff |
|
inherited |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
|
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.
|
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.
int getNumberOfTasks | ( | ) | const |
Returns the number of tasks in the collection.
Use this value when trying to retrieve all tasks using getTask().
ms_security_task getTask | ( | const int | num | ) | const |
Returns a particular task.
num | should be in the range 0.. getNumberOfTasks() -1 |
ms_security_task getTaskFromID | ( | const int | taskID | ) | const |
Returns a particular task.
Find a task in the collection given its ID.
taskID | should be a valid taskID. |
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.
database | is the database name – for example MSDB. |
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.
taskID | The taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration – for example, matrix_science::ms_security_tasks::SECTASK_ADMINPAGES. |
bool isPermitted_double | ( | const int | taskID, |
const double | value | ||
) | const |
See if the value is in the floating point parameter list.
taskID | The taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration – for example, matrix_science::ms_security_tasks::SECTASK_MAXQUERIES. |
value | is the value for comparison. |
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.
taskID | The taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration – for example, matrix_science::ms_security_tasks::SECTASK_MAXQUERIES. |
value | is the value for comparison. |
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.
taskID | The taskID normally from the matrix_science::ms_security_tasks::TASKID enumeration – for example, matrix_science::ms_security_tasks::SECTASK_NAMEDFASTA. |
value | Is the value for comparison. |
bool isTaskExists | ( | const int | taskID | ) | const |
Returns true if a task with this ID exists.
taskID | Task ID to check. |
|
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.
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.
taskID | Should be a valid task ID. |
bool updateTask | ( | const ms_security_task & | task | ) |
Updates a task in the list with new parameters.
task | Replace the definition for a task in the list with this. |