Muster SDK  8.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MUser.h
Go to the documentation of this file.
1 /*****************************************************************************
2  **
3  ** Header file for Muster API User object
4  **
5  ** Name : MUser.h
6  ** Author : Leonardo Bernardini
7  ** Version : 1.0, Sat Mar 2nd 2013
8  **
9  ** Copyright 2000-2014, Virtual Vertex
10  ** All Rights Reserved.
11  **
12  ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13  ** The contents of this file may not be disclosed to third parties, copied
14  ** or duplicated in any form, in whole or in part, without the prior written
15  ** permission of the author.
16  **
17  *****************************************************************************/
18 #ifndef MUSER_H
19 #define MUSER_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MCLIENTLIB_EXPORTS
24 #define MCLIENTLIB_API __declspec(dllexport)
25 #else
26 #define MCLIENTLIB_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MCLIENTLIB_EXPORTS
31 #ifdef LINUX
32 #define MCLIENTLIB_API
33 #else
34 #define MCLIENTLIB_API
35 #endif
36 #else
37 #define MCLIENTLIB_API
38 #endif
39 #endif
40 
41 
42 // Disable STL Export warning, member is private, we don't need direct access from the DLL client
43 #if defined(_WIN32)
44 #pragma warning(disable: 4251)
45 #endif // _WIN32
46 
47 #include <string>
48 #include <list>
49 #include <vector>
50 
51 namespace MClientLib {
52 
57  public:
58  static const unsigned long long kUserRightJobsManageSelf = 0x01ULL;
59  static const unsigned long long kUserRightJobsManageOthers = 0x02ULL;
60  static const unsigned long long kUserRightJobsChangePriority = 0x04ULL;
61  static const unsigned long long kUserRightJobsDeleteSelf = 0x08ULL;
62  static const unsigned long long kUserRightJobsDeleteOthers = 0x10ULL;
63  static const unsigned long long kUserRightJobsLockSelf = 0x20ULL;
64  static const unsigned long long kUserRightJobsLockOthers = 0x40ULL;
65  static const unsigned long long kUserRightNodesChangeStatus = 0x80ULL;
66  static const unsigned long long kUserRightNodesManageProcesses = 0x100ULL;
67  static const unsigned long long kUserRightNodesSetNotes = 0x200ULL;
68  static const unsigned long long kUserRightNodesManageLog = 0x400ULL;
69  static const unsigned long long kUserRightNodesManageExclusions = 0x800ULL;
70  static const unsigned long long kUserRightNodesSoftRestart = 0x2000ULL;
71  static const unsigned long long kUserRightNodesSendEvents = 0x4000ULL;
72  static const unsigned long long kUserRightNodesChangePriority = 0x8000ULL;
73  static const unsigned long long kUserRightNodesChangeConfig = 0x10000ULL;
74  static const unsigned long long kUserRightDispatcherChangeConfigs = 0x20000ULL;
75  static const unsigned long long kUserRightDispatcherChangeStatus = 0x30000ULL;
76  static const unsigned long long kUserRightDispatcherSoftRestart = 0x80000ULL;
77  static const unsigned long long kUserRightSendJobs = 0x100000ULL;
78  static const unsigned long long kUserRightClearLog = 0x200000ULL;
79  static const unsigned long long kUserRightChangeOwnPassword = 0x400000ULL;
80  static const unsigned long long kUserRightLoginEnabled = 0x800000ULL;
81  static const unsigned long long kUserRightWebLoginEnabled = 0x1000000ULL;
82  static const unsigned long long kUserRightManageJobsHistory = 0x2000000ULL;
83  static const unsigned long long kUserRightImportQueue = 0x4000000ULL;
84  static const unsigned long long kUserRightIsAdmin = 0x10000000ULL;
85  static const unsigned long long kUserRightArchiveJobsBelogingToSelf = 0x20000000ULL;
86  static const unsigned long long kUserRightArchiveJobsBelogingToOthers = 0x40000000ULL;
87  static const unsigned long long kUserRightExportQueue = 0x80000000ULL;
88  static const unsigned long long kUserRightReceiveCpuTraffic = 0x100000000ULL;
89  static const unsigned long long kUserRightReceiveCpuTrafficUpdates = 0x200000000ULL;
90  static const unsigned long long kUserRightReceiveJobsTraffic = 0x400000000ULL;
91  static const unsigned long long kUserRightReceiveJobsTrafficUpdatesForOwnJobs = 0x800000000ULL;
92  static const unsigned long long kUserRightReceiveJobsTrafficUpdatedForJobsBelongingToOthers = 0x1000000000ULL;
93  static const unsigned long long kUserRightReceiveChunksTraffic = 0x2000000000ULL;
94  static const unsigned long long kUserRightReceiveChunksTrafficForChunksBelogingToOthers = 0x4000000000ULL;
95  static const unsigned long long kUserRightReceiveChunksTrafficUpdatesForOwnChunks = 0x8000000000ULL;
96  static const unsigned long long kUserRightReceiveChunksTrafficUpdatesForChunksBelogingToOthers = 0x10000000000ULL;
97  static const unsigned long long kUserRightReceiveLogTraffic = 0x20000000000ULL;
98  static const unsigned long long kUserRightReceiveLogUpdates = 0x80000000000ULL;
99  static const unsigned long long kUserRightConfigureRepositories = 0x100000000000ULL;
100  static const unsigned long long kUserRightConfigureAccounts = 0x200000000000ULL;
101  static const unsigned long long kUserRightConfigurePools = 0x400000000000ULL;
102  static const unsigned long long kUserRightConfigureMails = 0x800000000000ULL;
103  static const unsigned long long kUserRightConfigureTemplates = 0x1000000000000ULL;
104  static const unsigned long long kUserRightSubmitScripts = 0x2000000000000ULL;
105  static const unsigned long long kUserRightFullRights = 0xFFFFFFFFFFFFFFFFULL;
106 
107  static const unsigned long long kUserRightDefaultGroupRights =
108  kUserRightReceiveLogUpdates | kUserRightReceiveLogTraffic | kUserRightReceiveChunksTrafficUpdatesForChunksBelogingToOthers |
109  kUserRightReceiveChunksTrafficUpdatesForOwnChunks | kUserRightReceiveChunksTrafficForChunksBelogingToOthers |
110  kUserRightReceiveChunksTraffic | kUserRightReceiveJobsTrafficUpdatedForJobsBelongingToOthers | kUserRightReceiveJobsTrafficUpdatesForOwnJobs |
111  kUserRightReceiveJobsTrafficUpdatesForOwnJobs | kUserRightReceiveJobsTrafficUpdatesForOwnJobs | kUserRightReceiveJobsTraffic |
112  kUserRightReceiveCpuTrafficUpdates | kUserRightReceiveCpuTraffic | kUserRightArchiveJobsBelogingToSelf | kUserRightWebLoginEnabled |
113  kUserRightLoginEnabled | kUserRightChangeOwnPassword | kUserRightSendJobs | kUserRightJobsDeleteSelf | kUserRightJobsManageSelf ;
114 
115  private:
116  long id;
117  std::string accountName;
118  std::string groups;
119  std::string allowedPools;
120  std::string allowedTemplates;
121  std::string emailAddress;
122  std::string encodedPassword;
123  unsigned long long allowedRights;
124  unsigned long long forbiddenRights;
125  int allowedInstances;
126  long homeFolderID;
127  bool constrainToHomeFolder;
128  std::string substitutionPaths; // User level assigned paths
129  bool isLdap;
130  public:
131  MUser();
132 
133  virtual ~MUser();
134 
135  virtual void setId(long _id);
136  virtual void setAccountName(const std::string& _accountName);
137  virtual void setGroups(const std::string& _groups);
138  virtual void setEncodedPassword(const std::string& _encodedPassword);
139  virtual void setAllowedPools(const std::string& _allowedPools);
140  virtual void setAllowedTemplates(const std::string& _allowedTemplates);
141  virtual void setAllowedRights(unsigned long long _rightsMask);
142  virtual void setForbiddenRights(unsigned long long _rightsMask);
143  virtual void setAllowedInstances(int _allowedInstances);
144  virtual void setHomeFolderID(long _homeFolderID);
145  virtual void setConstrainToHomeFolder(bool _contrainToHomeFolder);
146  virtual void setSubstitutionPaths(const std::string& _substitutionPaths);
147  virtual void setEMailAddress(const std::string& _emailAddress);
148  virtual void setIsLdap(bool _isLDAP);
149 
150  virtual long getId();
151  virtual std::string getAccountName();
152  virtual std::string getGroups();
153  virtual std::string getAllowedPools();
154  virtual std::string getAllowedTemplates();
155  virtual int getAllowedInstances();
156  virtual long getHomeFolderID();
157  virtual bool getConstrainToHomeFolder();
158  virtual std::string getSubstitutionPaths();
159  virtual unsigned long long getAllowedRights();
160  virtual unsigned long long getForbiddenRights();
161  virtual std::string getEMailAddress();
162  virtual bool getIsLdap();
163  virtual std::string getEncodedPassword();
164 
165  virtual bool Unmarshall(const std::vector<std::string>& items);
166  virtual std::string Marshall();
167 
168  void castedRelease();
169  };
170 
171 
172 }
173 
174 #endif