basesecurity.hpp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef BASESECURITY_INCL
  14. #define BASESECURITY_INCL
  15. #include <stdlib.h>
  16. #include "seclib.hpp"
  17. #include "jliball.hpp"
  18. #include "SecureUser.hpp"
  19. #include "SecurityResource.hpp"
  20. #include "SecurityResourceList.hpp"
  21. class CBaseSecurityManager : implements ISecManager, public CInterface
  22. {
  23. public:
  24. IMPLEMENT_IINTERFACE
  25. CBaseSecurityManager()
  26. {
  27. }
  28. CBaseSecurityManager(const char *serviceName, IPropertyTree *config)
  29. {
  30. }
  31. ~CBaseSecurityManager()
  32. {
  33. }
  34. //ISecManager
  35. ISecUser * createUser(const char * user_name)
  36. {
  37. return new CSecureUser(user_name, NULL);
  38. }
  39. ISecResourceList * createResourceList(const char * rlname)
  40. {
  41. return new CSecurityResourceList(rlname);
  42. }
  43. bool subscribe(ISecAuthenticEvents & events)
  44. {
  45. throwUnexpected();
  46. }
  47. bool unsubscribe(ISecAuthenticEvents & events)
  48. {
  49. throwUnexpected();
  50. }
  51. bool authorize(ISecUser & user, ISecResourceList * resources, IEspSecureContext* secureContext)
  52. {
  53. throwUnexpected();
  54. }
  55. bool authorizeEx(SecResourceType rtype, ISecUser & user, ISecResourceList * resources, IEspSecureContext* secureContext)
  56. {
  57. throwUnexpected();
  58. }
  59. SecAccessFlags authorizeEx(SecResourceType rtype, ISecUser & user, const char * resourcename, IEspSecureContext* secureContext)
  60. {
  61. throwUnexpected();
  62. }
  63. SecAccessFlags getAccessFlagsEx(SecResourceType rtype, ISecUser & user, const char * resourcename)
  64. {
  65. throwUnexpected();
  66. }
  67. SecAccessFlags authorizeFileScope(ISecUser & user, const char * filescope)
  68. {
  69. throwUnexpected();
  70. }
  71. bool authorizeFileScope(ISecUser & user, ISecResourceList * resources)
  72. {
  73. throwUnexpected();
  74. }
  75. bool authorizeViewScope(ISecUser & user, ISecResourceList * resources)
  76. {
  77. throwUnexpected();
  78. }
  79. bool addResources(ISecUser & user, ISecResourceList * resources)
  80. {
  81. throwUnexpected();
  82. }
  83. bool addResourcesEx(SecResourceType rtype, ISecUser & user, ISecResourceList * resources, SecPermissionType ptype, const char * basedn)
  84. {
  85. throwUnexpected();
  86. }
  87. bool addResourceEx(SecResourceType rtype, ISecUser & user, const char * resourcename, SecPermissionType ptype, const char * basedn)
  88. {
  89. throwUnexpected();
  90. }
  91. bool getResources(SecResourceType rtype, const char * basedn, IResourceArray & resources)
  92. {
  93. throwUnexpected();
  94. }
  95. bool updateResources(ISecUser & user, ISecResourceList * resources)
  96. {
  97. throwUnexpected();
  98. }
  99. bool updateSettings(ISecUser & user, ISecPropertyList * resources, IEspSecureContext* secureContext)
  100. {
  101. throwUnexpected();
  102. }
  103. bool addUser(ISecUser & user)
  104. {
  105. throwUnexpected();
  106. }
  107. ISecUser * findUser(const char * username)
  108. {
  109. throwUnexpected();
  110. }
  111. ISecUser * lookupUser(unsigned uid)
  112. {
  113. throwUnexpected();
  114. }
  115. ISecUserIterator * getAllUsers()
  116. {
  117. throwUnexpected();
  118. }
  119. void getAllGroups(StringArray & groups, StringArray & managedBy, StringArray & descriptions )
  120. {
  121. throwUnexpected();
  122. }
  123. bool updateUserPassword(ISecUser & user, const char * newPassword, const char* currPassword = 0)
  124. {
  125. throwUnexpected();
  126. }
  127. bool initUser(ISecUser & user)
  128. {
  129. throwUnexpected();
  130. }
  131. void setExtraParam(const char * name, const char * value)
  132. {
  133. throwUnexpected();
  134. }
  135. IAuthMap * createAuthMap(IPropertyTree * authconfig)
  136. {
  137. throwUnexpected();
  138. }
  139. IAuthMap * createFeatureMap(IPropertyTree * authconfig)
  140. {
  141. throwUnexpected();
  142. }
  143. IAuthMap * createSettingMap(IPropertyTree * authconfig)
  144. {
  145. throwUnexpected();
  146. }
  147. void deleteResource(SecResourceType rtype, const char * name, const char * basedn)
  148. {
  149. throwUnexpected();
  150. }
  151. void renameResource(SecResourceType rtype, const char * oldname, const char * newname, const char * basedn)
  152. {
  153. throwUnexpected();
  154. }
  155. void copyResource(SecResourceType rtype, const char * oldname, const char * newname, const char * basedn)
  156. {
  157. throwUnexpected();
  158. }
  159. void cacheSwitch(SecResourceType rtype, bool on)
  160. {
  161. throwUnexpected();
  162. }
  163. bool authTypeRequired(SecResourceType rtype)
  164. {
  165. throwUnexpected();
  166. }
  167. SecAccessFlags authorizeWorkunitScope(ISecUser & user, const char * filescope)
  168. {
  169. throwUnexpected();
  170. }
  171. bool authorizeWorkunitScope(ISecUser & user, ISecResourceList * resources)
  172. {
  173. throwUnexpected();
  174. }
  175. const char * getDescription()
  176. {
  177. throwUnexpected();
  178. }
  179. unsigned getPasswordExpirationWarningDays()
  180. {
  181. throwUnexpected();
  182. }
  183. bool createUserScopes()
  184. {
  185. throwUnexpected();
  186. }
  187. aindex_t getManagedFileScopes(IArrayOf<ISecResource>& scopes)
  188. {
  189. throwUnexpected();
  190. }
  191. SecAccessFlags queryDefaultPermission(ISecUser& user)
  192. {
  193. throwUnexpected();
  194. }
  195. bool clearPermissionsCache(ISecUser & user)
  196. {
  197. throwUnexpected();
  198. }
  199. bool authenticateUser(ISecUser & user, bool *superUser)
  200. {
  201. throwUnexpected();
  202. }
  203. secManagerType querySecMgrType()
  204. {
  205. throwUnexpected();
  206. }
  207. const char* querySecMgrTypeName()
  208. {
  209. throwUnexpected();
  210. }
  211. bool logoutUser(ISecUser & user)
  212. {
  213. throwUnexpected();
  214. }
  215. };
  216. #endif // BASESECURITY_INCL
  217. //#endif