Muster SDK  8.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 kUserRightFullRights = 0xFFFFFFFFFFFFFFFFULL;
105 
106  static const unsigned long long kUserRightDefaultGroupRights =
107  kUserRightReceiveLogUpdates | kUserRightReceiveLogTraffic | kUserRightReceiveChunksTrafficUpdatesForChunksBelogingToOthers |
108  kUserRightReceiveChunksTrafficUpdatesForOwnChunks | kUserRightReceiveChunksTrafficForChunksBelogingToOthers |
109  kUserRightReceiveChunksTraffic | kUserRightReceiveJobsTrafficUpdatedForJobsBelongingToOthers | kUserRightReceiveJobsTrafficUpdatesForOwnJobs |
110  kUserRightReceiveJobsTrafficUpdatesForOwnJobs | kUserRightReceiveJobsTrafficUpdatesForOwnJobs | kUserRightReceiveJobsTraffic |
111  kUserRightReceiveCpuTrafficUpdates | kUserRightReceiveCpuTraffic | kUserRightArchiveJobsBelogingToSelf | kUserRightWebLoginEnabled |
112  kUserRightLoginEnabled | kUserRightChangeOwnPassword | kUserRightSendJobs | kUserRightJobsDeleteSelf | kUserRightJobsManageSelf;
113 
114  private:
115  long id;
116  std::string accountName;
117  std::string groups;
118  std::string allowedPools;
119  std::string allowedTemplates;
120  std::string emailAddress;
121  std::string encodedPassword;
122  unsigned long long allowedRights;
123  unsigned long long forbiddenRights;
124  int allowedInstances;
125  long homeFolderID;
126  bool constrainToHomeFolder;
127  std::string substitutionPaths; // User level assigned paths
128  bool isLdap;
129  public:
130  MUser();
131 
132  virtual ~MUser();
133 
134  virtual void setId(long _id);
135  virtual void setAccountName(const std::string& _accountName);
136  virtual void setGroups(const std::string& _groups);
137  virtual void setEncodedPassword(const std::string& _encodedPassword);
138  virtual void setAllowedPools(const std::string& _allowedPools);
139  virtual void setAllowedTemplates(const std::string& _allowedTemplates);
140  virtual void setAllowedRights(unsigned long long _primaryRightsMask);
141  virtual void setForbiddenRights(unsigned long long _primaryRightsMask);
142  virtual void setAllowedInstances(int _allowedInstances);
143  virtual void setHomeFolderID(long _homeFolderID);
144  virtual void setConstrainToHomeFolder(bool _contrainToHomeFolder);
145  virtual void setSubstitutionPaths(const std::string& _substitutionPaths);
146  virtual void setEMailAddress(const std::string& _emailAddress);
147  virtual void setIsLdap(bool _isLDAP);
148 
149  virtual long getId();
150  virtual std::string getAccountName();
151  virtual std::string getGroups();
152  virtual std::string getAllowedPools();
153  virtual std::string getAllowedTemplates();
154  virtual int getAllowedInstances();
155  virtual long getHomeFolderID();
156  virtual bool getConstrainToHomeFolder();
157  virtual std::string getSubstitutionPaths();
158  virtual unsigned long long getAllowedRights();
159  virtual unsigned long long getForbiddenRights();
160  virtual std::string getEMailAddress();
161  virtual bool getIsLdap();
162  virtual std::string getEncodedPassword();
163 
164  virtual bool Unmarshall(std::vector<std::string>& items);
165  virtual std::string Marshall();
166  };
167 
168 
169 }
170 
171 #endif