19#if !defined(mascot_session_DA3EC794_90F8_4c4f_AD5D_13C3B6971A51__INCLUDED_)
20#define mascot_session_DA3EC794_90F8_4c4f_AD5D_13C3B6971A51__INCLUDED_
30namespace matrix_science {
36 class ms_security_options;
126 ms_session(
const std::string session_id =
"");
130 const std::string userPassword);
134 const std::string connectionID,
135 const std::string database);
138 ms_session(
const int timeout,
const std::string prefix);
141#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
150#if !defined(DOXYGEN_SHOULD_SKIP_THIS) && !defined(SWIG)
152 const std::string &session_id);
162 std::string getID()
const;
165 int getUserID()
const;
168 std::string getUserName()
const;
171 std::string getFullUserName()
const;
174 std::string getEmailAddress()
const;
177 bool isSecurityEnabled()
const;
180 time_t getLastAccessed()
const;
183 time_t getTimeout()
const;
186 std::string getIPAddress()
const;
195 std::map<std::string, std::string> getParams()
const;
198 bool isPermitted(
const int taskID)
const;
201 bool isPermitted_long(
const int taskID,
const long value)
const;
204 bool isPermitted_double(
const int taskID,
const double value)
const;
207 bool isPermitted_string(
const int taskID,
const std::string value)
const;
210 bool isFastaPermitted(
const std::string database)
const;
213 bool canResultsFileBeViewed(
const int userID)
const;
216 bool saveStringParam(
const std::string name,
const std::string param);
219 bool saveIntParam(
const std::string name,
int param);
222 bool saveLongParam(
const std::string name,
long param);
225 bool saveTimeParam(
const std::string name, time_t param);
228 bool saveDoubleParam(
const std::string name,
double param);
231 bool saveBoolParam(
const std::string name,
bool param);
235 bool getStringParam(
const std::string name, std::string & param)
const;
238 std::string getStringParam(
const std::string name)
const;
241 bool getIntParam(
const std::string name,
int & param)
const;
244 int getIntParam(
const std::string name)
const;
247 bool getLongParam(
const std::string name,
long & param)
const;
250 long getLongParam(
const std::string name)
const;
253 bool getTimeParam(
const std::string name, time_t & param)
const;
256 time_t getTimeParam(
const std::string name)
const;
259 bool getDoubleParam(
const std::string name,
double & param)
const;
262 double getDoubleParam(
const std::string name)
const;
265 bool getBoolParam(
const std::string name,
bool & param)
const;
268 bool clearParam(
const std::string name);
274 bool isTimedOut()
const;
283 std::vector<int> getSpoofableUsers()
const;
286 typedef std::map<std::string, std::string> param_t;
287 std::string sessionID_;
289 param_t customParams_;
290 typedef std::set<std::string> cpIdentifier_t;
291 cpIdentifier_t systemIdentifiers_;
293 bool saveParamShouldSaveFile_;
294 bool allowParamAndFileSaving_;
297 bool loadSessionFromFile(
const ms_security *
const sec);
298 bool saveSessionToFile(
const ms_security *
const sec);
301 bool setGuestSession();
302 bool doesSessionFileExist(
const std::string sess);
304 std::string getSessionIDFromUser(
const ms_user & user);
305 std::string getWebSvrAuthSessionID(std::string userName =
"");
306 bool checkIPAddressOrComputerName(
const std::string ipAddress,
307 std::string & sessionID);
308 bool checkAgentString(std::string & sessionID);
309 bool validateIntegraPassword(
const ms_user & u,
311 const std::string & userPassword,
312 std::string & session_id,
313 int & errorFlag)
const;
314 bool verifyIntegraConnection()
const;
315 bool isSessionIdentical(
const ms_session & sess)
const;
317 void createSessionFromID(
const std::string session_id);
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
Options for the Mascot security system.
Definition: ms_security_options.hpp:46
Each group has permission to do one or more tasks. This class defines a collection of tasks.
Definition: ms_security_tasks.hpp:51
The main security class to be used by the administration application.
Definition: ms_security.hpp:94
Use this class to determine if a user is logged in and if they have 'permission' to perform tasks.
Definition: ms_security_session.hpp:123
This class will normally only be used by Mascot Security Administration applications.
Definition: ms_security_user.hpp:49
usertype
Definitions for types of user.
Definition: ms_security_user.hpp:57