ws_access.ecm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  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. ESPstruct UserInfo
  14. {
  15. string username;
  16. string fullname;
  17. [min_ver("1.07")] string passwordexpiration;
  18. };
  19. ESPstruct GroupInfo
  20. {
  21. string name;
  22. bool deletable;
  23. };
  24. ESPstruct AccountPermission
  25. {
  26. string basedn;
  27. string RType;
  28. string rname;
  29. string rtitle;
  30. string prefix;
  31. string ResourceName;
  32. string PermissionName;
  33. bool allow_access;
  34. bool allow_read;
  35. bool allow_write;
  36. bool allow_full;
  37. bool deny_access;
  38. bool deny_read;
  39. bool deny_write;
  40. bool deny_full;
  41. };
  42. ESPstruct GroupAccountPermission
  43. {
  44. string GroupName;
  45. [min_ver("1.06")] ESParray<string> BasednNames;
  46. ESParray<ESPstruct AccountPermission, Permission> Permissions;
  47. };
  48. ESPrequest UserRequest
  49. {
  50. string searchinput;
  51. };
  52. ESPresponse UserResponse
  53. {
  54. [min_ver("1.04")] bool NoSecMngr(false);
  55. bool toomany;
  56. bool posixok;
  57. ESParray<ESPstruct UserInfo, User> Users;
  58. };
  59. ESPrequest UserEditRequest
  60. {
  61. string username;
  62. };
  63. ESPresponse UserEditResponse
  64. {
  65. string username;
  66. ESParray<ESPstruct GroupInfo, Group> Groups;
  67. };
  68. ESPrequest UserGroupEditInputRequest
  69. {
  70. string username;
  71. };
  72. ESPresponse UserGroupEditInputResponse
  73. {
  74. string username;
  75. ESParray<ESPstruct GroupInfo, Group> Groups;
  76. };
  77. ESPrequest UserGroupEditRequest
  78. {
  79. string username;
  80. string action;
  81. ESParray<string> groupnames;
  82. };
  83. ESPresponse UserGroupEditResponse
  84. {
  85. string username;
  86. string action;
  87. int retcode;
  88. string retmsg;
  89. };
  90. ESPrequest UserPosixInputRequest
  91. {
  92. string username;
  93. };
  94. ESPresponse UserPosixInputResponse
  95. {
  96. string username;
  97. bool posixenabled;
  98. string gidnumber;
  99. string uidnumber;
  100. string homedirectory;
  101. string loginshell;
  102. };
  103. ESPrequest UserPosixRequest
  104. {
  105. string username;
  106. bool posixenabled;
  107. string gidnumber;
  108. string uidnumber;
  109. string homedirectory;
  110. string loginshell;
  111. };
  112. ESPresponse UserPosixResponse
  113. {
  114. string username;
  115. int retcode;
  116. string retmsg;
  117. };
  118. ESPrequest UserSudoersInputRequest
  119. {
  120. string username;
  121. };
  122. ESPresponse UserSudoersInputResponse
  123. {
  124. string username;
  125. bool insudoers;
  126. string sudoHost;
  127. string sudoCommand;
  128. string sudoOption;
  129. };
  130. ESPrequest UserSudoersRequest
  131. {
  132. string username;
  133. string action;
  134. string sudoHost;
  135. string sudoCommand;
  136. string sudoOption;
  137. };
  138. ESPresponse UserSudoersResponse
  139. {
  140. string username;
  141. int retcode;
  142. string retmsg;
  143. };
  144. ESPrequest UserInfoEditInputRequest
  145. {
  146. string username;
  147. };
  148. ESPresponse UserInfoEditInputResponse
  149. {
  150. string username;
  151. string firstname;
  152. string lastname;
  153. };
  154. ESPrequest UserInfoEditRequest
  155. {
  156. string username;
  157. string firstname;
  158. string lastname;
  159. };
  160. ESPresponse UserInfoEditResponse
  161. {
  162. string username;
  163. int retcode;
  164. string retmsg;
  165. };
  166. ESPrequest AddUserRequest
  167. {
  168. [label("User Name"), cols(20)] string username;
  169. [label("First Name"), cols(20)] string firstname;
  170. [label("Last Name"), cols(20)] string lastname;
  171. [label("Password"), password, cols(20)] password1;
  172. [label("Retype password"), password, cols(20)] password2;
  173. };
  174. ESPresponse AddUserResponse
  175. {
  176. int retcode;
  177. string retmsg;
  178. };
  179. ESPrequest UserActionRequest
  180. {
  181. string action;
  182. string ActionType;
  183. ESParray<string> usernames;
  184. };
  185. ESPresponse UserActionResponse
  186. {
  187. string action;
  188. int retcode;
  189. string retmsg;
  190. };
  191. ESPrequest UserResetPassInputRequest
  192. {
  193. string username;
  194. };
  195. ESPresponse UserResetPassInputResponse
  196. {
  197. string username;
  198. };
  199. ESPrequest UserResetPassRequest
  200. {
  201. string username;
  202. string newPassword;
  203. string newPasswordRetype;
  204. };
  205. ESPresponse UserResetPassResponse
  206. {
  207. string username;
  208. int retcode;
  209. string retmsg;
  210. };
  211. ESPrequest GroupRequest
  212. {
  213. };
  214. ESPresponse GroupResponse
  215. {
  216. [min_ver("1.04")] bool NoSecMngr(false);
  217. ESParray<ESPstruct GroupInfo, Group> Groups;
  218. };
  219. ESPrequest GroupAddRequest
  220. {
  221. string groupname;
  222. };
  223. ESPresponse GroupAddResponse
  224. {
  225. string groupname;
  226. int retcode;
  227. string retmsg;
  228. };
  229. ESPrequest [nil_remove] GroupActionRequest
  230. {
  231. ESParray<string> groupnames;
  232. string ActionType;
  233. bool DeletePermission;
  234. };
  235. ESPresponse GroupActionResponse
  236. {
  237. string Groupnames;
  238. ESParray<ESPstruct AccountPermission, Permission> Permissions;
  239. int retcode;
  240. string retmsg;
  241. };
  242. ESPrequest GroupEditRequest
  243. {
  244. string groupname;
  245. };
  246. ESPresponse GroupEditResponse
  247. {
  248. string groupname;
  249. ESParray<ESPstruct UserInfo, User> Users;
  250. };
  251. ESPrequest GroupMemberEditInputRequest
  252. {
  253. string searchinput;
  254. string groupname;
  255. };
  256. ESPresponse GroupMemberEditInputResponse
  257. {
  258. string groupname;
  259. bool toomany;
  260. ESParray<ESPstruct UserInfo, User> Users;
  261. };
  262. ESPrequest GroupMemberEditRequest
  263. {
  264. string groupname;
  265. string action;
  266. ESParray<string> usernames;
  267. };
  268. ESPresponse GroupMemberEditResponse
  269. {
  270. string groupname;
  271. string action;
  272. int retcode;
  273. string retmsg;
  274. };
  275. ESPrequest BasednsRequest
  276. {
  277. };
  278. ESPstruct DnStruct
  279. {
  280. string name;
  281. string basedn;
  282. string rtype;
  283. string rtitle;
  284. string templatename;
  285. };
  286. ESPresponse BasednsResponse
  287. {
  288. [min_ver("1.04")] bool NoSecMngr(false);
  289. ESParray<ESPstruct DnStruct, Basedn> Basedns;
  290. };
  291. ESPrequest ResourcesRequest
  292. {
  293. string basedn;
  294. string rtype;
  295. string rtitle;
  296. string templatename;
  297. string prefix;
  298. string searchinput;
  299. };
  300. ESPstruct Resource
  301. {
  302. string name;
  303. string description;
  304. bool isSpecial;
  305. };
  306. ESPstruct ScopeScanStatusStruct
  307. {
  308. bool isEnabled;
  309. int retcode;
  310. string retmsg;
  311. };
  312. ESPresponse ResourcesResponse
  313. {
  314. string basedn;
  315. string rtype;
  316. string rtitle;
  317. ESParray<ESPstruct Resource, Resource> Resources;
  318. string default_basedn;
  319. string default_name;
  320. string prefix;
  321. [min_ver("1.05")] bool toomany;
  322. [min_ver("1.08")] ESPstruct ScopeScanStatusStruct scopeScansStatus;
  323. };
  324. ESPrequest ResourceAddInputRequest
  325. {
  326. string basedn;
  327. string rtype;
  328. string rtitle;
  329. string prefix;
  330. };
  331. ESPresponse ResourceAddInputResponse
  332. {
  333. string basedn;
  334. string rtype;
  335. string rtitle;
  336. string prefix;
  337. };
  338. ESPrequest ResourceAddRequest
  339. {
  340. string basedn;
  341. string rtype;
  342. string rtitle;
  343. string name;
  344. string description;
  345. string prefix;
  346. };
  347. ESPresponse ResourceAddResponse
  348. {
  349. string basedn;
  350. string rtype;
  351. string rtitle;
  352. string prefix;
  353. int retcode;
  354. string retmsg;
  355. };
  356. ESPrequest ResourceDeleteRequest
  357. {
  358. string basedn;
  359. string rtype;
  360. string rtitle;
  361. string prefix;
  362. ESParray<string> names;
  363. int DoUpdate(0);
  364. };
  365. ESPresponse ResourceDeleteResponse
  366. {
  367. string basedn;
  368. string rtype;
  369. string rtitle;
  370. string prefix;
  371. int retcode;
  372. string retmsg;
  373. };
  374. ESPrequest ResourcePermissionsRequest
  375. {
  376. string basedn;
  377. string rtype;
  378. string name;
  379. string rtitle;
  380. string prefix;
  381. };
  382. ESPstruct ResourcePermission
  383. {
  384. string account_name;
  385. string escaped_account_name;
  386. int account_type;
  387. bool allow_access;
  388. bool allow_read;
  389. bool allow_write;
  390. bool allow_full;
  391. bool deny_access;
  392. bool deny_read;
  393. bool deny_write;
  394. bool deny_full;
  395. };
  396. ESPresponse ResourcePermissionsResponse
  397. {
  398. string basedn;
  399. string rtype;
  400. string name;
  401. string rtitle;
  402. string prefix;
  403. ESParray<ESPstruct ResourcePermission, Permission> Permissions;
  404. };
  405. ESPrequest PermissionAddRequest
  406. {
  407. string basedn;
  408. string rtype;
  409. string rtitle;
  410. string rname;
  411. string prefix;
  412. [min_ver("1.01")] string BasednName;
  413. [min_ver("1.01")] string AccountName;
  414. [min_ver("1.01")] int AccountType;
  415. };
  416. ESPresponse PermissionAddResponse
  417. {
  418. string basedn;
  419. string rtype;
  420. string rtitle;
  421. string rname;
  422. string prefix;
  423. [min_ver("1.01")] string BasednName;
  424. [min_ver("1.01")] string AccountName;
  425. [min_ver("1.01")] int AccountType;
  426. bool toomany;
  427. ESParray<ESPstruct UserInfo, User> Users;
  428. ESParray<ESPstruct GroupInfo, Group> Groups;
  429. [min_ver("1.01")] ESParray<string> Resources;
  430. };
  431. ESPrequest PermissionsResetInputRequest
  432. {
  433. string basedn;
  434. string rtype;
  435. string rtitle;
  436. string rname;
  437. string prefix;
  438. ESParray<string> names;
  439. };
  440. ESPresponse PermissionsResetInputResponse
  441. {
  442. string basedn;
  443. string rtype;
  444. string rtitle;
  445. string rname;
  446. string prefix;
  447. bool toomany;
  448. ESParray<ESPstruct UserInfo, User> Users;
  449. ESParray<ESPstruct GroupInfo, Group> Groups;
  450. ESParray<string, Resource> Resources;
  451. string ResourceList;
  452. };
  453. ESPrequest PermissionsResetRequest
  454. {
  455. string basedn;
  456. string rtype;
  457. string rname;
  458. string rtitle;
  459. string prefix;
  460. ESParray<string> names;
  461. bool allow_access;
  462. bool allow_read;
  463. bool allow_write;
  464. bool allow_full;
  465. bool deny_access;
  466. bool deny_read;
  467. bool deny_write;
  468. bool deny_full;
  469. string userarray;
  470. string grouparray;
  471. };
  472. ESPresponse PermissionsResetResponse
  473. {
  474. string basedn;
  475. string rtype;
  476. string rname;
  477. string rtitle;
  478. string prefix;
  479. int retcode;
  480. string retmsg;
  481. };
  482. ESPrequest ClearPermissionsCacheRequest
  483. {
  484. };
  485. ESPresponse ClearPermissionsCacheResponse
  486. {
  487. int retcode;
  488. };
  489. ESPrequest QueryScopeScansEnabledRequest
  490. {
  491. };
  492. ESPresponse QueryScopeScansEnabledResponse
  493. {
  494. [min_ver("1.08")] ESPstruct ScopeScanStatusStruct scopeScansStatus;
  495. };
  496. ESPrequest EnableScopeScansRequest
  497. {
  498. };
  499. ESPresponse EnableScopeScansResponse
  500. {
  501. [min_ver("1.08")] ESPstruct ScopeScanStatusStruct scopeScansStatus;
  502. };
  503. ESPrequest DisableScopeScansRequest
  504. {
  505. };
  506. ESPresponse DisableScopeScansResponse
  507. {
  508. [min_ver("1.08")] ESPstruct ScopeScanStatusStruct scopeScansStatus;
  509. };
  510. ESPrequest PermissionActionRequest
  511. {
  512. string basedn;
  513. string rtype;
  514. string rname;
  515. string rtitle;
  516. string prefix;
  517. string action;
  518. string account_name;
  519. int account_type;
  520. bool allow_access;
  521. bool allow_read;
  522. bool allow_write;
  523. bool allow_full;
  524. bool deny_access;
  525. bool deny_read;
  526. bool deny_write;
  527. bool deny_full;
  528. string user;
  529. string group;
  530. [min_ver("1.01")] string BasednName;
  531. [min_ver("1.01")] string ResourceName;
  532. };
  533. ESPresponse PermissionActionResponse
  534. {
  535. string basedn;
  536. string rtype;
  537. string rname;
  538. string rtitle;
  539. string prefix;
  540. [min_ver("1.01")] string AccountName;
  541. [min_ver("1.01")] bool IsGroup;
  542. int retcode;
  543. string retmsg;
  544. };
  545. ESPrequest AccountPermissionsRequest
  546. {
  547. string AccountName;
  548. bool IsGroup;
  549. bool IncludeGroup(false);
  550. };
  551. ESPresponse AccountPermissionsResponse
  552. {
  553. string AccountName;
  554. bool IsGroup;
  555. [min_ver("1.03")] bool IncludeGroup;
  556. ESParray<string> BasednNames;
  557. ESParray<ESPstruct AccountPermission, Permission> Permissions;
  558. //[min_ver("1.03")] ESParray<ESPstruct AccountPermission, Permission> AuthUsersPermission;
  559. //[min_ver("1.03")] ESParray<ESPstruct AccountPermission, Permission> EveryonePermission;
  560. [min_ver("1.03")] ESParray<ESPstruct GroupAccountPermission, GroupPermission> GroupPermissions;
  561. };
  562. ESPrequest [nil_remove] FilePermissionRequest
  563. {
  564. string FileName;
  565. string UserName;
  566. string GroupName;
  567. };
  568. ESPresponse [nil_remove] FilePermissionResponse
  569. {
  570. [min_ver("1.04")] bool NoSecMngr(false);
  571. string FileName;
  572. string UserName;
  573. string GroupName;
  574. bool toomany;
  575. ESParray<ESPstruct UserInfo, User> Users;
  576. ESParray<ESPstruct GroupInfo, Group> Groups;
  577. ///ESPstruct AccountPermission Permission; //Support permission change later
  578. string UserPermission;
  579. };
  580. ESPrequest [nil_remove] UserAccountExportRequest
  581. {
  582. ESParray<string> usernames;
  583. ESParray<string> groupnames;
  584. };
  585. ESPresponse [nil_remove] UserAccountExportResponse
  586. {
  587. [http_content("application/octet-stream")] binary Result;
  588. };
  589. ESPservice [version("1.08"), default_client_version("1.08"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_access
  590. {
  591. ESPmethod [client_xslt("/esp/xslt/access_users.xslt")] Users(UserRequest, UserResponse);
  592. ESPmethod [client_xslt("/esp/xslt/access_useredit.xslt")] UserEdit(UserEditRequest, UserEditResponse);
  593. ESPmethod [client_xslt("/esp/xslt/access_resetpassinput.xslt")] UserResetPassInput(UserResetPassInputRequest, UserResetPassInputResponse);
  594. ESPmethod [client_xslt("/esp/xslt/access_resetpass.xslt")] UserResetPass(UserResetPassRequest, UserResetPassResponse);
  595. ESPmethod [client_xslt("/esp/xslt/access_usergroupeditinput.xslt")] UserGroupEditInput(UserGroupEditInputRequest, UserGroupEditInputResponse);
  596. ESPmethod [client_xslt("/esp/xslt/access_usergroupedit.xslt")] UserGroupEdit(UserGroupEditRequest, UserGroupEditResponse);
  597. ESPmethod [client_xslt("/esp/xslt/access_posix.xslt")] UserPosix(UserPosixRequest, UserPosixResponse);
  598. ESPmethod [client_xslt("/esp/xslt/access_posixinput.xslt")] UserPosixInput(UserPosixInputRequest, UserPosixInputResponse);
  599. ESPmethod [client_xslt("/esp/xslt/access_sudoersinput.xslt")] UserSudoersInput(UserSudoersInputRequest, UserSudoersInputResponse);
  600. ESPmethod [client_xslt("/esp/xslt/access_sudoers.xslt")] UserSudoers(UserSudoersRequest, UserSudoersResponse);
  601. ESPmethod [client_xslt("/esp/xslt/access_userinfoeditinput.xslt")] UserInfoEditInput(UserInfoEditInputRequest, UserInfoEditInputResponse);
  602. ESPmethod [client_xslt("/esp/xslt/access_userinfoedit.xslt")] UserInfoEdit(UserInfoEditRequest, UserInfoEditResponse);
  603. ESPmethod [client_xslt("/esp/xslt/access_groups.xslt")] Groups(GroupRequest, GroupResponse);
  604. ESPmethod [client_xslt("/esp/xslt/access_groupadd.xslt")] GroupAdd(GroupAddRequest, GroupAddResponse);
  605. ESPmethod [client_xslt("/esp/xslt/access_groupdelete.xslt")] GroupAction(GroupActionRequest, GroupActionResponse);
  606. ESPmethod [client_xslt("/esp/xslt/access_groupedit.xslt")] GroupEdit(GroupEditRequest, GroupEditResponse);
  607. ESPmethod [client_xslt("/esp/xslt/access_groupmembereditinput.xslt")] GroupMemberEditInput(GroupMemberEditInputRequest, GroupMemberEditInputResponse);
  608. ESPmethod [client_xslt("/esp/xslt/access_groupmemberedit.xslt")] GroupMemberEdit(GroupMemberEditRequest, GroupMemberEditResponse);
  609. ESPmethod [client_xslt("/esp/xslt/access_adduser.xslt")] AddUser(AddUserRequest, AddUserResponse);
  610. ESPmethod [client_xslt("/esp/xslt/access_useraction.xslt")] UserAction(UserActionRequest, UserActionResponse);
  611. ESPmethod [client_xslt("/esp/xslt/access_basedns.xslt")] Permissions(BasednsRequest, BasednsResponse);
  612. ESPmethod [client_xslt("/esp/xslt/access_resources.xslt")] Resources(ResourcesRequest, ResourcesResponse);
  613. ESPmethod [client_xslt("/esp/xslt/access_resourceadd.xslt")] ResourceAdd(ResourceAddRequest, ResourceAddResponse);
  614. ESPmethod [client_xslt("/esp/xslt/access_resourcedelete.xslt")] ResourceDelete(ResourceDeleteRequest, ResourceDeleteResponse);
  615. ESPmethod [client_xslt("/esp/xslt/access_resourceaddinput.xslt")] ResourceAddInput(ResourceAddInputRequest, ResourceAddInputResponse);
  616. ESPmethod [client_xslt("/esp/xslt/access_permissions.xslt")] ResourcePermissions(ResourcePermissionsRequest, ResourcePermissionsResponse);
  617. ESPmethod [client_xslt("/esp/xslt/access_permissionaddinput.xslt")] PermissionAddInput(PermissionAddRequest, PermissionAddResponse);
  618. ESPmethod [client_xslt("/esp/xslt/access_permissionchange.xslt")] PermissionAction(PermissionActionRequest, PermissionActionResponse);
  619. ESPmethod [client_xslt("/esp/xslt/access_accountpermissions.xslt")] AccountPermissions(AccountPermissionsRequest, AccountPermissionsResponse);
  620. ESPmethod [client_xslt("/esp/xslt/access_filepermission.xslt")] FilePermission(FilePermissionRequest, FilePermissionResponse);
  621. ESPmethod [client_xslt("/esp/xslt/access_permissionresetinput.xslt")] PermissionsResetInput(PermissionsResetInputRequest, PermissionsResetInputResponse);
  622. ESPmethod [client_xslt("/esp/xslt/access_permissionsreset.xslt")] PermissionsReset(PermissionsResetRequest, PermissionsResetResponse);
  623. ESPmethod [client_xslt("/esp/xslt/access_clearpermissionscache.xslt")] ClearPermissionsCache(ClearPermissionsCacheRequest, ClearPermissionsCacheResponse);
  624. ESPmethod QueryScopeScansEnabled(QueryScopeScansEnabledRequest, QueryScopeScansEnabledResponse);
  625. ESPmethod [client_xslt("/esp/xslt/access_enablescopescans.xslt")] EnableScopeScans(EnableScopeScansRequest, EnableScopeScansResponse);
  626. ESPmethod [client_xslt("/esp/xslt/access_disablescopescans.xslt")] DisableScopeScans(DisableScopeScansRequest, DisableScopeScansResponse);
  627. //ESPmethod [client_xslt("/esp/xslt/access_useraccountexport.xslt")] UserAccountExport(UserAccountExportRequest, UserAccountExportResponse);
  628. ESPmethod UserAccountExport(UserAccountExportRequest, UserAccountExportResponse);
  629. };
  630. SCMexportdef(ws_access);
  631. SCMapi(ws_access) IClientws_access *createws_accessClient();